##Install Packages if Needed
if (!require("ggplot2")) install.packages("ggplot2")
if (!require("cowplot")) install.packages("cowplot")
if (!require("Rmisc")) install.packages("Rmisc")
if (!require("lme4")) install.packages("lme4")
if (!require("lmerTest")) install.packages("lmerTest")
Loading required package: lmerTest
Attaching package: ‘lmerTest’
The following object is masked from ‘package:lme4’:
lmer
The following object is masked from ‘package:stats’:
step
if (!require("vegan")) install.packages("vegan")
if (!require("corrplot")) install.packages("corrplot")
if (!require("DHARMa")) install.packages("DHARMa")
if (!require("effectsize")) install.packages("effectsize")
if (!require("emmeans")) install.packages("emmeans")
if (!require("Hmisc")) install.packages("Hmisc")
if (!require("dplyr")) install.packages("dplyr")
if (!require("tidyr")) install.packages("tidyr")
##Load Packages
library(ggplot2) #Required for ggplots
library(cowplot) #Required for plotting panel figures
library(Rmisc) #Required for SummarySE function
library(lme4) #Required for mixed effects modeling
library(lmerTest) #Required for p values with lme4 model summaries
library(vegan) #Required for multivariate analysis PERM
library(corrplot) #Required for correlation plot
library(DHARMa) #Required to check residuals of mixed effects models
library(effectsize) #Required for eta_squared effect sizes
library(emmeans) #Required for pairwise comparisons
library(Hmisc) #Required for correlations
library(dplyr) #Required for dataframe organization
library(tidyr) #Required for dataframe organization
#Note: Run "Graphing Parameters" section from 01_ExperimentalSetup.Rmd file
##Load Data
#Note: Physiological metrics calculated in 02_PhysiologyMetrics.R file
Coral<-read.csv("Outputs/CoralData.csv", header=TRUE)
##Set factor variables
Coral$TimeP<-factor(Coral$TimeP, levels=c("TP1", "TP2", "TP3", "TP4"))
Coral$Site<-factor(Coral$Site, levels=c("KL", "SS"))
Coral$Genotype<-factor(Coral$Genotype, levels=c("AC8", "AC10", "AC12"))
Coral$Orig<-factor(Coral$Orig, levels=c("N", "T"))
Coral$Origin<-factor(Coral$Origin, levels=c("Native", "Transplant"))
Coral$Site.Orig<-factor(Coral$Site.Orig, levels=c("KL.N", "KL.T", "SS.N", "SS.T"))
#' Calculate (partial) Omega-squared (effect-size calculation) for PERMANOVA and add it to the input object
#'
#' @param adonisOutput An adonis object
#' @param partial Should partial omega-squared be calculated (sample size adjusted). Default TRUE
#' @return Original adonis object with the (partial) Omega-squared values added
#' @import vegan
#' @export
adonis_OmegaSq <- function(adonisOutput, partial = TRUE){
if(!(is(adonisOutput, "adonis") || is(adonisOutput, "anova.cca")))
stop("Input should be an adonis object")
if (is(adonisOutput, "anova.cca")) {
aov_tab <- adonisOutput
aov_tab$MeanSqs <- aov_tab$SumOfSqs / aov_tab$Df
aov_tab$MeanSqs[length(aov_tab$Df)] <- NA
} else {
aov_tab <- adonisOutput$aov.tab
}
heading <- attr(aov_tab, "heading")
MS_res <- aov_tab[pmatch("Residual", rownames(aov_tab)), "MeanSqs"]
SS_tot <- aov_tab[rownames(aov_tab) == "Total", "SumsOfSqs"]
N <- aov_tab[rownames(aov_tab) == "Total", "Df"] + 1
if(partial){
omega <- apply(aov_tab, 1, function(x) (x["Df"]*(x["MeanSqs"]-MS_res))/(x["Df"]*x["MeanSqs"]+(N-x["Df"])*MS_res))
aov_tab$parOmegaSq <- c(omega[1:(length(omega)-2)], NA, NA)
} else {
omega <- apply(aov_tab, 1, function(x) (x["SumsOfSqs"]-x["Df"]*MS_res)/(SS_tot+MS_res))
aov_tab$OmegaSq <- c(omega[1:(length(omega)-2)], NA, NA)
}
if (is(adonisOutput, "adonis"))
cn_order <- c("Df", "SumsOfSqs", "MeanSqs", "F.Model", "R2",
if (partial) "parOmegaSq" else "OmegaSq", "Pr(>F)")
else
cn_order <- c("Df", "SumOfSqs", "F", if (partial) "parOmegaSq" else "OmegaSq",
"Pr(>F)")
aov_tab <- aov_tab[, cn_order]
attr(aov_tab, "names") <- cn_order
attr(aov_tab, "heading") <- heading
if (is(adonisOutput, "adonis"))
adonisOutput$aov.tab <- aov_tab
else
adonisOutput <- aov_tab
return(adonisOutput)
}
##Remove NA's
names(Coral)
[1] "ID" "RandN" "TimeP" "Site" "Genotype"
[6] "Orig" "Origin" "Set" "Site.Orig" "SA_cm2"
[11] "TP_ug.cm2_C" "TP_ug.cm2_S" "AFDW_mg.cm2_C" "AFDW_mg.cm2_S" "AFDW_mg.cm2_S.C"
[16] "Chl_ug.cm2"
Coral.rm<-na.omit(Coral)
##Log +1 transform
Coral.log<-Coral.rm
Coral.log[,-c(1:10)]<-log(Coral.rm[,-c(1:10)]+1)
Phys.cor<-rcorr(as.matrix(Coral.log[,-c(1:10)]), type="pearson")
Phys.cor
TP_ug.cm2_C TP_ug.cm2_S AFDW_mg.cm2_C AFDW_mg.cm2_S AFDW_mg.cm2_S.C Chl_ug.cm2
TP_ug.cm2_C 1.00 0.56 0.55 0.48 0.03 0.37
TP_ug.cm2_S 0.56 1.00 0.37 0.41 0.08 0.16
AFDW_mg.cm2_C 0.55 0.37 1.00 0.37 -0.49 0.33
AFDW_mg.cm2_S 0.48 0.41 0.37 1.00 0.60 0.50
AFDW_mg.cm2_S.C 0.03 0.08 -0.49 0.60 1.00 0.20
Chl_ug.cm2 0.37 0.16 0.33 0.50 0.20 1.00
n= 190
P
TP_ug.cm2_C TP_ug.cm2_S AFDW_mg.cm2_C AFDW_mg.cm2_S AFDW_mg.cm2_S.C Chl_ug.cm2
TP_ug.cm2_C 0.0000 0.0000 0.0000 0.6401 0.0000
TP_ug.cm2_S 0.0000 0.0000 0.0000 0.2762 0.0248
AFDW_mg.cm2_C 0.0000 0.0000 0.0000 0.0000 0.0000
AFDW_mg.cm2_S 0.0000 0.0000 0.0000 0.0000 0.0000
AFDW_mg.cm2_S.C 0.6401 0.2762 0.0000 0.0000 0.0049
Chl_ug.cm2 0.0000 0.0248 0.0000 0.0000 0.0049
diag(Phys.cor$P)<-0
corrplot(Phys.cor$r, type="upper", order="hclust",
p.mat = Phys.cor$P, sig.level = 0.01, insig = "blank")
##Subset Timepoint 1
Coral.log_TP1<-subset(Coral.log, TimeP=="TP1")
##PERMANOVA
Coral.TP1.perm<-adonis2(vegdist(Coral.log_TP1[,c(11:14, 16)], "euclidean")~ Coral.log_TP1$Origin * Coral.log_TP1$Site, data=Coral.log_TP1, strata=Coral.log_TP1$Genotype, method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP1.perm)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP1[, c(11:14, 16)], "euclidean") ~ Coral.log_TP1$Origin * Coral.log_TP1$Site, data = Coral.log_TP1, method = "euclidean", strata = Coral.log_TP1$Genotype)
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP1$Origin 1 0.2789 2.7121 0.034440 0.010 **
Coral.log_TP1$Site 1 0.3722 3.6196 0.051750 0.003 **
Coral.log_TP1$Origin:Coral.log_TP1$Site 1 0.3433 3.3384 0.046454 0.004 **
Residual 44 4.5240
Total 47 5.5183
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
##Check dispersion by Origin
TP1.disp_orig<-anova(betadisper(vegdist(Coral.log_TP1[,c(11:14, 16)], "euclidean"), Coral.log_TP1$Origin))
TP1.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.01547 0.015468 1.0199 0.3178
Residuals 46 0.69768 0.015167
##Check dispersion by Site
TP1.disp_site<-anova(betadisper(vegdist(Coral.log_TP1[,c(11:14, 16)], "euclidean"), Coral.log_TP1$Site))
TP1.disp_site
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.04842 0.048424 3.1669 0.08175 .
Residuals 46 0.70338 0.015291
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
##Check dispersion by Origin:Site
TP1.disp_os<-anova(betadisper(vegdist(Coral.log_TP1[,c(11:14, 16)], "euclidean"), Coral.log_TP1$Origin:Coral.log_TP1$Site))
TP1.disp_os
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 3 0.02212 0.0073726 0.5649 0.641
Residuals 44 0.57425 0.0130512
##Save results
PERM_T1.res<-data.frame(adonis_OmegaSq(Coral.TP1.perm)[1:3,])
PERM_T1.res$Predictor<-c("Origin", "Site", "Origin x Site")
PERM_T1.res$p_DISP<-c(TP1.disp_orig$`Pr(>F)`[1], TP1.disp_site$`Pr(>F)`[1], TP1.disp_os$`Pr(>F)`[1])
Physiology differs significantly by Origin and the effect of Origin differs between Sites.
Calculate Effect Size of Origin for each Site
##KL
##PERMANOVA
Coral.TP1.perm_KL<-adonis2(vegdist(Coral.log_TP1[which(Coral.log_TP1$Site=="KL"),c(11:14, 16)], "euclidean")~ Coral.log_TP1$Origin[which(Coral.log_TP1$Site=="KL")], data=Coral.log_TP1[which(Coral.log_TP1$Site=="KL"),], strata=Coral.log_TP1$Genotype[which(Coral.log_TP1$Site=="KL")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP1.perm_KL)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP1[which(Coral.log_TP1$Site == "KL"), c(11:14, 16)], "euclidean") ~ Coral.log_TP1$Origin[which(Coral.log_TP1$Site == "KL")], data = Coral.log_TP1[which(Coral.log_TP1$Site == "KL"), ], method = "euclidean", strata = Coral.log_TP1$Genotype[which(Coral.log_TP1$Site == "KL")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP1$Origin[which(Coral.log_TP1$Site == "KL")] 1 0.05913 0.6453 -0.015001 0.435
Residual 22 2.01586
Total 23 2.07498
##Check dispersion by Origin
TP1.KL.disp_orig<-anova(betadisper(vegdist(Coral.log_TP1[which(Coral.log_TP1$Site=="KL"),c(11:14, 16)], "euclidean"), Coral.log_TP1$Origin[which(Coral.log_TP1$Site=="KL")]))
TP1.KL.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.002019 0.0020194 0.1424 0.7095
Residuals 22 0.311986 0.0141812
##SS
##PERMANOVA
Coral.TP1.perm_SS<-adonis2(vegdist(Coral.log_TP1[which(Coral.log_TP1$Site=="SS"),c(11:14, 16)], "euclidean")~ Coral.log_TP1$Origin[which(Coral.log_TP1$Site=="SS")], data=Coral.log_TP1[which(Coral.log_TP1$Site=="SS"),], strata=Coral.log_TP1$Genotype[which(Coral.log_TP1$Site=="SS")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP1.perm_SS)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP1[which(Coral.log_TP1$Site == "SS"), c(11:14, 16)], "euclidean") ~ Coral.log_TP1$Origin[which(Coral.log_TP1$Site == "SS")], data = Coral.log_TP1[which(Coral.log_TP1$Site == "SS"), ], method = "euclidean", strata = Coral.log_TP1$Genotype[which(Coral.log_TP1$Site == "SS")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP1$Origin[which(Coral.log_TP1$Site == "SS")] 1 0.56298 4.9381 0.14096 0.001 ***
Residual 22 2.50815
Total 23 3.07113
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
##Check dispersion by Origin
TP1.SS.disp_orig<-anova(betadisper(vegdist(Coral.log_TP1[which(Coral.log_TP1$Site=="SS"),c(11:14, 16)], "euclidean"), Coral.log_TP1$Origin[which(Coral.log_TP1$Site=="SS")]))
TP1.SS.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.000018 0.0000178 0.0015 0.9695
Residuals 22 0.262265 0.0119211
##Save results
PERM_T1.site.res<-data.frame(adonis_OmegaSq(Coral.TP1.perm_KL)[1,])
PERM_T1.site.res<-rbind(PERM_T1.site.res, data.frame(adonis_OmegaSq(Coral.TP1.perm_SS)[1,]))
PERM_T1.site.res$Predictor<-c("KL Origin", "SS Origin")
PERM_T1.site.res$p_DISP<-c(TP1.KL.disp_orig$`Pr(>F)`[1], TP1.SS.disp_orig$`Pr(>F)`[1])
##Combine results
PERM_T1.res<-rbind(PERM_T1.res, PERM_T1.site.res)
PERM_T1.res$Timepoint<-rep("TP1", nrow(PERM_T1.res))
##Subset Timepoint 2
Coral.log_TP2<-subset(Coral.log, TimeP=="TP2")
##PERMANOVA
Coral.TP2.perm<-adonis2(vegdist(Coral.log_TP2[,c(11:14, 16)], "euclidean")~ Coral.log_TP2$Origin * Coral.log_TP2$Site, data=Coral.log_TP2, strata=Coral.log_TP2$Genotype, method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP2.perm)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP2[, c(11:14, 16)], "euclidean") ~ Coral.log_TP2$Origin * Coral.log_TP2$Site, data = Coral.log_TP2, method = "euclidean", strata = Coral.log_TP2$Genotype)
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP2$Origin 1 0.0347 0.420 -0.01223 0.660
Coral.log_TP2$Site 1 2.0831 25.239 0.33554 0.001 ***
Coral.log_TP2$Origin:Coral.log_TP2$Site 1 0.2762 3.346 0.04660 0.030 *
Residual 44 3.6315
Total 47 6.0255
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
##Check dispersion by Origin
TP2.disp_orig<-anova(betadisper(vegdist(Coral.log_TP2[,c(11:14, 16)], "euclidean"), Coral.log_TP2$Origin))
TP2.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.02892 0.028918 1.1826 0.2825
Residuals 46 1.12482 0.024453
##Check dispersion by Site
TP2.disp_site<-anova(betadisper(vegdist(Coral.log_TP2[,c(11:14, 16)], "euclidean"), Coral.log_TP2$Site))
TP2.disp_site
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.00701 0.0070126 0.5917 0.4457
Residuals 46 0.54518 0.0118518
##Check dispersion by Origin:Site
TP2.disp_os<-anova(betadisper(vegdist(Coral.log_TP2[,c(11:14, 16)], "euclidean"), Coral.log_TP2$Origin:Coral.log_TP2$Site))
TP2.disp_os
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 3 0.02003 0.0066763 0.6202 0.6057
Residuals 44 0.47364 0.0107645
##Save results
PERM_T2.res<-data.frame(adonis_OmegaSq(Coral.TP2.perm)[1:3,])
PERM_T2.res$Predictor<-c("Origin", "Site", "Origin x Site")
PERM_T2.res$p_DISP<-c(TP2.disp_orig$`Pr(>F)`[1], TP2.disp_site$`Pr(>F)`[1], TP2.disp_os$`Pr(>F)`[1])
Calculate Effect Size of Origin for each Site
##KL
##PERMANOVA
Coral.TP2.perm_KL<-adonis2(vegdist(Coral.log_TP2[which(Coral.log_TP2$Site=="KL"),c(11:14, 16)], "euclidean")~ Coral.log_TP2$Origin[which(Coral.log_TP2$Site=="KL")], data=Coral.log_TP2[which(Coral.log_TP2$Site=="KL"),], strata=Coral.log_TP2$Genotype[which(Coral.log_TP2$Site=="KL")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP2.perm_KL)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP2[which(Coral.log_TP2$Site == "KL"), c(11:14, 16)], "euclidean") ~ Coral.log_TP2$Origin[which(Coral.log_TP2$Site == "KL")], data = Coral.log_TP2[which(Coral.log_TP2$Site == "KL"), ], method = "euclidean", strata = Coral.log_TP2$Genotype[which(Coral.log_TP2$Site == "KL")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP2$Origin[which(Coral.log_TP2$Site == "KL")] 1 0.18146 2.5268 0.059813 0.037 *
Residual 22 1.57991
Total 23 1.76137
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
##Check dispersion by Origin
TP2.KL.disp_orig<-anova(betadisper(vegdist(Coral.log_TP2[which(Coral.log_TP2$Site=="KL"),c(11:14, 16)], "euclidean"), Coral.log_TP2$Origin[which(Coral.log_TP2$Site=="KL")]))
TP2.KL.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.000732 0.0007320 0.0896 0.7675
Residuals 22 0.179698 0.0081681
##SS
##PERMANOVA
Coral.TP2.perm_SS<-adonis2(vegdist(Coral.log_TP2[which(Coral.log_TP2$Site=="SS"),c(11:14, 16)], "euclidean")~ Coral.log_TP2$Origin[which(Coral.log_TP2$Site=="SS")], data=Coral.log_TP2[which(Coral.log_TP2$Site=="SS"),], strata=Coral.log_TP2$Genotype[which(Coral.log_TP2$Site=="SS")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP2.perm_SS)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP2[which(Coral.log_TP2$Site == "SS"), c(11:14, 16)], "euclidean") ~ Coral.log_TP2$Origin[which(Coral.log_TP2$Site == "SS")], data = Coral.log_TP2[which(Coral.log_TP2$Site == "SS"), ], method = "euclidean", strata = Coral.log_TP2$Genotype[which(Coral.log_TP2$Site == "SS")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP2$Origin[which(Coral.log_TP2$Site == "SS")] 1 0.12937 1.3872 0.015878 0.144
Residual 22 2.05163
Total 23 2.18100
##Check dispersion by Origin
TP2.SS.disp_orig<-anova(betadisper(vegdist(Coral.log_TP2[which(Coral.log_TP2$Site=="SS"),c(11:14, 16)], "euclidean"), Coral.log_TP2$Origin[which(Coral.log_TP2$Site=="SS")]))
TP2.SS.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.006276 0.0062764 0.4698 0.5003
Residuals 22 0.293942 0.0133610
##Save results
PERM_T2.site.res<-data.frame(adonis_OmegaSq(Coral.TP2.perm_KL)[1,])
PERM_T2.site.res<-rbind(PERM_T2.site.res, data.frame(adonis_OmegaSq(Coral.TP2.perm_SS)[1,]))
PERM_T2.site.res$Predictor<-c("KL Origin", "SS Origin")
PERM_T2.site.res$p_DISP<-c(TP2.KL.disp_orig$`Pr(>F)`[1], TP2.SS.disp_orig$`Pr(>F)`[1])
##Combine results
PERM_T2.res<-rbind(PERM_T2.res, PERM_T2.site.res)
PERM_T2.res$Timepoint<-rep("TP2", nrow(PERM_T2.res))
##Subset Timepoint 3
Coral.log_TP3<-subset(Coral.log, TimeP=="TP3")
##PERMANOVA
Coral.TP3.perm<-adonis2(vegdist(Coral.log_TP3[,c(11:14, 16)], "euclidean")~ Coral.log_TP3$Origin * Coral.log_TP3$Site, data=Coral.log_TP3, strata=Coral.log_TP3$Genotype, method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP3.perm)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP3[, c(11:14, 16)], "euclidean") ~ Coral.log_TP3$Origin * Coral.log_TP3$Site, data = Coral.log_TP3, method = "euclidean", strata = Coral.log_TP3$Genotype)
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP3$Origin 1 0.1051 0.7853 -0.004493 0.342
Coral.log_TP3$Site 1 1.4021 10.4738 0.164837 0.001 ***
Coral.log_TP3$Origin:Coral.log_TP3$Site 1 0.1024 0.7649 -0.004921 0.376
Residual 44 5.8901
Total 47 7.4997
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
##Check dispersion by Origin
TP3.disp_orig<-anova(betadisper(vegdist(Coral.log_TP3[,c(11:14, 16)], "euclidean"), Coral.log_TP3$Origin))
TP3.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.06528 0.065278 2.0695 0.157
Residuals 46 1.45099 0.031543
##Check dispersion by Site
TP3.disp_site<-anova(betadisper(vegdist(Coral.log_TP3[,c(11:14, 16)], "euclidean"), Coral.log_TP3$Site))
TP3.disp_site
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.00202 0.002024 0.0609 0.8062
Residuals 46 1.52934 0.033246
##Check dispersion by Origin:Site
TP3.disp_os<-anova(betadisper(vegdist(Coral.log_TP3[,c(11:14, 16)], "euclidean"), Coral.log_TP3$Origin:Coral.log_TP3$Site))
TP3.disp_os
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 3 0.09225 0.030751 0.975 0.4131
Residuals 44 1.38769 0.031538
##Save results
PERM_T3.res<-data.frame(adonis_OmegaSq(Coral.TP3.perm)[1:3,])
PERM_T3.res$Predictor<-c("Origin", "Site", "Origin x Site")
PERM_T3.res$p_DISP<-c(TP3.disp_orig$`Pr(>F)`[1], TP3.disp_site$`Pr(>F)`[1], TP3.disp_os$`Pr(>F)`[1])
Calculate Effect Size of Origin for each Site
##KL
##PERMANOVA
Coral.TP3.perm_KL<-adonis2(vegdist(Coral.log_TP3[which(Coral.log_TP3$Site=="KL"),c(11:14, 16)], "euclidean")~ Coral.log_TP3$Origin[which(Coral.log_TP3$Site=="KL")], data=Coral.log_TP3[which(Coral.log_TP3$Site=="KL"),], strata=Coral.log_TP3$Genotype[which(Coral.log_TP3$Site=="KL")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP3.perm_KL)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP3[which(Coral.log_TP3$Site == "KL"), c(11:14, 16)], "euclidean") ~ Coral.log_TP3$Origin[which(Coral.log_TP3$Site == "KL")], data = Coral.log_TP3[which(Coral.log_TP3$Site == "KL"), ], method = "euclidean", strata = Coral.log_TP3$Genotype[which(Coral.log_TP3$Site == "KL")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP3$Origin[which(Coral.log_TP3$Site == "KL")] 1 0.17515 1.5145 0.020987 0.171
Residual 22 2.54431
Total 23 2.71946
##Check dispersion by Origin
TP3.KL.disp_orig<-anova(betadisper(vegdist(Coral.log_TP3[which(Coral.log_TP3$Site=="KL"),c(11:14, 16)], "euclidean"), Coral.log_TP3$Origin[which(Coral.log_TP3$Site=="KL")]))
TP3.KL.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.00703 0.0070337 0.3193 0.5778
Residuals 22 0.48467 0.0220307
##SS
##PERMANOVA
Coral.TP3.perm_SS<-adonis2(vegdist(Coral.log_TP3[which(Coral.log_TP3$Site=="SS"),c(11:14, 16)], "euclidean")~ Coral.log_TP3$Origin[which(Coral.log_TP3$Site=="SS")], data=Coral.log_TP3[which(Coral.log_TP3$Site=="SS"),], strata=Coral.log_TP3$Genotype[which(Coral.log_TP3$Site=="SS")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP3.perm_SS)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP3[which(Coral.log_TP3$Site == "SS"), c(11:14, 16)], "euclidean") ~ Coral.log_TP3$Origin[which(Coral.log_TP3$Site == "SS")], data = Coral.log_TP3[which(Coral.log_TP3$Site == "SS"), ], method = "euclidean", strata = Coral.log_TP3$Genotype[which(Coral.log_TP3$Site == "SS")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP3$Origin[which(Coral.log_TP3$Site == "SS")] 1 0.0324 0.2129 -0.03391 0.779
Residual 22 3.3458
Total 23 3.3782
##Check dispersion by Origin
TP3.SS.disp_orig<-anova(betadisper(vegdist(Coral.log_TP3[which(Coral.log_TP3$Site=="SS"),c(11:14, 16)], "euclidean"), Coral.log_TP3$Origin[which(Coral.log_TP3$Site=="SS")]))
TP3.SS.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.07949 0.079485 1.9365 0.178
Residuals 22 0.90301 0.041046
##Save results
PERM_T3.site.res<-data.frame(adonis_OmegaSq(Coral.TP3.perm_KL)[1,])
PERM_T3.site.res<-rbind(PERM_T3.site.res, data.frame(adonis_OmegaSq(Coral.TP3.perm_SS)[1,]))
PERM_T3.site.res$Predictor<-c("KL Origin", "SS Origin")
PERM_T3.site.res$p_DISP<-c(TP3.KL.disp_orig$`Pr(>F)`[1], TP3.SS.disp_orig$`Pr(>F)`[1])
##Combine results
PERM_T3.res<-rbind(PERM_T3.res, PERM_T3.site.res)
PERM_T3.res$Timepoint<-rep("TP3", nrow(PERM_T3.res))
##Subset Timepoint 4
Coral.log_TP4<-subset(Coral.log, TimeP=="TP4")
##PERMANOVA
Coral.TP4.perm<-adonis2(vegdist(Coral.log_TP4[,c(11:14, 16)], "euclidean")~ Coral.log_TP4$Origin * Coral.log_TP4$Site, data=Coral.log_TP4, strata=Coral.log_TP4$Genotype, method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP4.perm)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP4[, c(11:14, 16)], "euclidean") ~ Coral.log_TP4$Origin * Coral.log_TP4$Site, data = Coral.log_TP4, method = "euclidean", strata = Coral.log_TP4$Genotype)
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP4$Origin 1 0.0204 0.1301 -0.019276 0.921
Coral.log_TP4$Site 1 2.5446 16.2273 0.248701 0.001 ***
Coral.log_TP4$Origin:Coral.log_TP4$Site 1 0.2287 1.4586 0.009870 0.198
Residual 42 6.5861
Total 45 9.3799
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
##Check dispersion by Origin
TP4.disp_orig<-anova(betadisper(vegdist(Coral.log_TP4[,c(11:14, 16)], "euclidean"), Coral.log_TP4$Origin))
TP4.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.00639 0.006388 0.1952 0.6608
Residuals 44 1.44022 0.032732
##Check dispersion by Site
TP4.disp_site<-anova(betadisper(vegdist(Coral.log_TP4[,c(11:14, 16)], "euclidean"), Coral.log_TP4$Site))
TP4.disp_site
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.01153 0.011529 0.3704 0.5459
Residuals 44 1.36932 0.031121
##Check dispersion by Origin:Site
TP4.disp_os<-anova(betadisper(vegdist(Coral.log_TP4[,c(11:14, 16)], "euclidean"), Coral.log_TP4$Origin:Coral.log_TP4$Site))
TP4.disp_os
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 3 0.04203 0.014012 0.4161 0.7423
Residuals 42 1.41428 0.033673
##Save results
PERM_T4.res<-data.frame(adonis_OmegaSq(Coral.TP4.perm)[1:3,])
PERM_T4.res$Predictor<-c("Origin", "Site", "Origin x Site")
PERM_T4.res$p_DISP<-c(TP4.disp_orig$`Pr(>F)`[1], TP4.disp_site$`Pr(>F)`[1], TP4.disp_os$`Pr(>F)`[1])
Calculate Effect Size of Origin for each Site
##KL
##PERMANOVA
Coral.TP4.perm_KL<-adonis2(vegdist(Coral.log_TP4[which(Coral.log_TP4$Site=="KL"),c(11:14, 16)], "euclidean")~ Coral.log_TP4$Origin[which(Coral.log_TP4$Site=="KL")], data=Coral.log_TP4[which(Coral.log_TP4$Site=="KL"),], strata=Coral.log_TP4$Genotype[which(Coral.log_TP4$Site=="KL")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP4.perm_KL)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP4[which(Coral.log_TP4$Site == "KL"), c(11:14, 16)], "euclidean") ~ Coral.log_TP4$Origin[which(Coral.log_TP4$Site == "KL")], data = Coral.log_TP4[which(Coral.log_TP4$Site == "KL"), ], method = "euclidean", strata = Coral.log_TP4$Genotype[which(Coral.log_TP4$Site == "KL")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP4$Origin[which(Coral.log_TP4$Site == "KL")] 1 0.0676 0.3774 -0.027823 0.688
Residual 21 3.7601
Total 22 3.8277
##Check dispersion by Origin
TP4.KL.disp_orig<-anova(betadisper(vegdist(Coral.log_TP4[which(Coral.log_TP4$Site=="KL"),c(11:14, 16)], "euclidean"), Coral.log_TP4$Origin[which(Coral.log_TP4$Site=="KL")]))
TP4.KL.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.00316 0.003160 0.0776 0.7833
Residuals 21 0.85503 0.040716
##SS
##PERMANOVA
Coral.TP4.perm_SS<-adonis2(vegdist(Coral.log_TP4[which(Coral.log_TP4$Site=="SS"),c(11:14, 16)], "euclidean")~ Coral.log_TP4$Origin[which(Coral.log_TP4$Site=="SS")], data=Coral.log_TP4[which(Coral.log_TP4$Site=="SS"),], strata=Coral.log_TP4$Genotype[which(Coral.log_TP4$Site=="SS")], method="euclidean")
##Effect Size
adonis_OmegaSq(Coral.TP4.perm_SS)
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Blocks: strata
Permutation: free
Number of permutations: 999
adonis2(formula = vegdist(Coral.log_TP4[which(Coral.log_TP4$Site == "SS"), c(11:14, 16)], "euclidean") ~ Coral.log_TP4$Origin[which(Coral.log_TP4$Site == "SS")], data = Coral.log_TP4[which(Coral.log_TP4$Site == "SS"), ], method = "euclidean", strata = Coral.log_TP4$Genotype[which(Coral.log_TP4$Site == "SS")])
Df SumOfSqs F parOmegaSq Pr(>F)
Coral.log_TP4$Origin[which(Coral.log_TP4$Site == "SS")] 1 0.18154 1.349 0.014948 0.138
Residual 21 2.82599
Total 22 3.00753
##Check dispersion by Origin
TP4.SS.disp_orig<-anova(betadisper(vegdist(Coral.log_TP4[which(Coral.log_TP4$Site=="SS"),c(11:14, 16)], "euclidean"), Coral.log_TP4$Origin[which(Coral.log_TP4$Site=="SS")]))
TP4.SS.disp_orig
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.02157 0.021572 0.81 0.3783
Residuals 21 0.55925 0.026631
##Save results
PERM_T4.site.res<-data.frame(adonis_OmegaSq(Coral.TP4.perm_KL)[1,])
PERM_T4.site.res<-rbind(PERM_T4.site.res, data.frame(adonis_OmegaSq(Coral.TP4.perm_SS)[1,]))
PERM_T4.site.res$Predictor<-c("KL Origin", "SS Origin")
PERM_T4.site.res$p_DISP<-c(TP4.KL.disp_orig$`Pr(>F)`[1], TP4.SS.disp_orig$`Pr(>F)`[1])
##Combine results
PERM_T4.res<-rbind(PERM_T4.res, PERM_T4.site.res)
PERM_T4.res$Timepoint<-rep("TP4", nrow(PERM_T4.res))
##Subset Timepoint 1
Coral.TP1<-subset(Coral.rm, TimeP=="TP1")
##Check normality
hist(Coral.TP1$TP_ug.cm2_C)
shapiro.test(Coral.TP1$TP_ug.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP1$TP_ug.cm2_C
W = 0.98637, p-value = 0.8448
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.C.lme_TP1<-lmer(TP_ug.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP1)
##Check residuals
Prot.C.lme_res_TP1 <- simulateResiduals(fittedModel = Prot.C.lme_TP1, plot = F)
plot(Prot.C.lme_res_TP1)
##Model results
summary(Prot.C.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP1
REML criterion at convergence: 476.8
Scaled residuals:
Min 1Q Median 3Q Max
-1.98711 -0.58176 -0.00143 0.76130 1.61635
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 1703 41.27
Residual 2107 45.91
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 340.714 27.262 2.948 12.498 0.00120 **
OriginTransplant 3.303 18.741 42.000 0.176 0.86096
SiteSS 55.261 18.741 42.000 2.949 0.00519 **
OriginTransplant:SiteSS -31.334 26.504 42.000 -1.182 0.24375
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.344
SiteSS -0.344 0.500
OrgnTrn:SSS 0.243 -0.707 -0.707
eta_squared(Prot.C.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.02 | [0.00, 1.00]
Site | 0.18 | [0.04, 1.00]
Origin:Site | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.C_TP1.res<-data.frame(summary(Prot.C.lme_TP1)$coefficients[-1,])
Prot.C_TP1.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.C_TP1.res$EtaSq<-c(eta_squared(Prot.C.lme_TP1)$Eta2)
Prot.C_TP1.res$Response<-rep("Protein Host", nrow(Prot.C_TP1.res))
##Check normality
hist(Coral.TP1$TP_ug.cm2_S)
shapiro.test(Coral.TP1$TP_ug.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP1$TP_ug.cm2_S
W = 0.96018, p-value = 0.1027
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.S.lme_TP1<-lmer(TP_ug.cm2_S~Origin*Site+(1|Genotype), data=Coral.TP1)
##Check residuals
Prot.S.lme_res_TP1 <- simulateResiduals(fittedModel = Prot.S.lme_TP1, plot = F)
plot(Prot.S.lme_res_TP1)
##Model results
summary(Prot.S.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin * Site + (1 | Genotype)
Data: Coral.TP1
REML criterion at convergence: 504.7
Scaled residuals:
Min 1Q Median 3Q Max
-1.99771 -0.58981 -0.06134 0.48297 2.49136
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 1613 40.17
Residual 4087 63.93
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 459.014 29.638 3.945 15.488 0.000111 ***
OriginTransplant 1.258 26.100 42.000 0.048 0.961800
SiteSS 42.145 26.100 42.000 1.615 0.113851
OriginTransplant:SiteSS -86.531 36.910 42.000 -2.344 0.023864 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.440
SiteSS -0.440 0.500
OrgnTrn:SSS 0.311 -0.707 -0.707
eta_squared(Prot.S.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.11 | [0.01, 1.00]
Site | 8.78e-05 | [0.00, 1.00]
Origin:Site | 0.12 | [0.01, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.S_TP1.res<-data.frame(summary(Prot.S.lme_TP1)$coefficients[-1,])
Prot.S_TP1.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.S_TP1.res$EtaSq<-c(eta_squared(Prot.S.lme_TP1)$Eta2)
Prot.S_TP1.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP1.res))
Effect size of Origin for each Site
##KL
Prot.S.lme_TP1_KL<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="KL"),])
summary(Prot.S.lme_TP1_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "KL"), ]
REML criterion at convergence: 254.6
Scaled residuals:
Min 1Q Median 3Q Max
-1.64984 -0.68376 -0.07079 0.30913 2.31492
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 2602 51.01
Residual 4223 64.99
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 459.014 34.918 2.724 13.145 0.00153 **
OriginTransplant 1.258 26.531 20.000 0.047 0.96267
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.380
eta_squared(Prot.S.lme_TP1_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 1.12e-04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Prot.S.lme_TP1_SS<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="SS"),])
summary(Prot.S.lme_TP1_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "SS"), ]
REML criterion at convergence: 251.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.7405 -0.5819 -0.2580 0.6750 2.1154
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 695.5 26.37
Residual 3899.6 62.45
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 501.158 23.596 3.921 21.239 3.4e-05 ***
OriginTransplant -85.273 25.494 20.000 -3.345 0.00323 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.540
eta_squared(Prot.S.lme_TP1_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.36 | [0.10, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Prot.S_TP1.site.res<-data.frame(rbind(summary(Prot.S.lme_TP1_KL)$coefficients[-1,],
summary(Prot.S.lme_TP1_SS)$coefficients[-1,]))
Prot.S_TP1.site.res$Predictor<-c("KL Origin", "SS Origin")
Prot.S_TP1.site.res$EtaSq<-c(eta_squared(Prot.S.lme_TP1_KL)$Eta2, eta_squared(Prot.S.lme_TP1_SS)$Eta2)
Prot.S_TP1.site.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP1.site.res))
##Combine results
Prot.S_TP1.res<-rbind(Prot.S_TP1.res, Prot.S_TP1.site.res)
##Summary statistics by Site and Origin
TP1_ProtSym.sum<-summarySE(Coral.TP1, measurevar="TP_ug.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Protein across Treatments
TP1_ProtSym.plot<-ggplot(TP1_ProtSym.sum, aes(x=Site, y=TP_ug.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=TP_ug.cm2_S-se, ymax=TP_ug.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Protein (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(250, 550)+
annotate("text", x=2, y=535, label="**", size=sig.sz, fontface="bold"); TP1_ProtSym.plot
##Check normality
hist(Coral.TP1$AFDW_mg.cm2_C)
shapiro.test(Coral.TP1$AFDW_mg.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP1$AFDW_mg.cm2_C
W = 0.96547, p-value = 0.1677
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.C.lme_TP1<-lmer(AFDW_mg.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP1)
##Check residuals
Bio.C.lme_res_TP1 <- simulateResiduals(fittedModel = Bio.C.lme_TP1, plot = F)
plot(Bio.C.lme_res_TP1)
##Model results
summary(Bio.C.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP1
REML criterion at convergence: 17.9
Scaled residuals:
Min 1Q Median 3Q Max
-2.3616 -0.6323 0.1012 0.6827 1.4522
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.006352 0.0797
Residual 0.067274 0.2594
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.20320 0.08788 9.02171 13.691 2.43e-07 ***
OriginTransplant -0.18538 0.10589 42.00000 -1.751 0.0873 .
SiteSS -0.01392 0.10589 42.00000 -0.131 0.8961
OriginTransplant:SiteSS 0.04772 0.14975 42.00000 0.319 0.7516
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.602
SiteSS -0.602 0.500
OrgnTrn:SSS 0.426 -0.707 -0.707
eta_squared(Bio.C.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.10 | [0.00, 1.00]
Site | 4.20e-04 | [0.00, 1.00]
Origin:Site | 2.41e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.C_TP1.res<-data.frame(summary(Bio.C.lme_TP1)$coefficients[-1,])
Bio.C_TP1.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.C_TP1.res$EtaSq<-c(eta_squared(Bio.C.lme_TP1)$Eta2)
Bio.C_TP1.res$Response<-rep("Biomass Host", nrow(Bio.C_TP1.res))
Effect size of Origin for each Site
##KL
Bio.C.lme_TP1_KL<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="KL"),])
summary(Bio.C.lme_TP1_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "KL"), ]
REML criterion at convergence: 1.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.61169 -0.43907 0.07185 0.60072 1.71208
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.003322 0.05764
Residual 0.047206 0.21727
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.2032 0.0710 5.1663 16.95 9.99e-06 ***
OriginTransplant -0.1854 0.0887 20.0000 -2.09 0.0496 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.625
eta_squared(Bio.C.lme_TP1_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.18 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.C.lme_TP1_SS<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="SS"),])
summary(Bio.C.lme_TP1_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "SS"), ]
REML criterion at convergence: 15.4
Scaled residuals:
Min 1Q Median 3Q Max
-1.9881 -0.5903 0.3895 0.6868 1.3845
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0002328 0.01526
Residual 0.0939949 0.30659
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.18928 0.08894 7.15744 13.37 2.53e-06 ***
OriginTransplant -0.13767 0.12516 20.00012 -1.10 0.284
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.704
eta_squared(Bio.C.lme_TP1_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.06 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.C_TP1.site.res<-data.frame(rbind(summary(Bio.C.lme_TP1_KL)$coefficients[-1,],
summary(Bio.C.lme_TP1_SS)$coefficients[-1,]))
Bio.C_TP1.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.C_TP1.site.res$EtaSq<-c(eta_squared(Bio.C.lme_TP1_KL)$Eta2, eta_squared(Bio.C.lme_TP1_SS)$Eta2)
Bio.C_TP1.site.res$Response<-rep("Biomass Host", nrow(Bio.C_TP1.site.res))
##Combine results
Bio.C_TP1.res<-rbind(Bio.C_TP1.res, Bio.C_TP1.site.res)
##Summary statistics by Site and Origin
TP1_BioHost.sum<-summarySE(Coral.TP1, measurevar="AFDW_mg.cm2_C", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Host Biomass across Treatments
TP1_BioHost.plot<-ggplot(TP1_BioHost.sum, aes(x=Site, y=AFDW_mg.cm2_C, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_C-se, ymax=AFDW_mg.cm2_C+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position = "top")+
labs(x="Site and Origin", y=expression(paste('Host Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.8, 1.6)+
annotate("text", x=1, y=1.3, label="*", size=sig.sz, fontface="bold"); TP1_BioHost.plot
##Check normality
hist(Coral.TP1$AFDW_mg.cm2_S)
shapiro.test(Coral.TP1$AFDW_mg.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP1$AFDW_mg.cm2_S
W = 0.97584, p-value = 0.4194
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.S.lme_TP1<-lmer(AFDW_mg.cm2_S~Origin*Site+(1|Genotype), data=Coral.TP1)
##Check residuals
Bio.S.lme_res_TP1 <- simulateResiduals(fittedModel = Bio.S.lme_TP1, plot = F)
plot(Bio.S.lme_res_TP1)
##Model results
summary(Bio.S.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin * Site + (1 | Genotype)
Data: Coral.TP1
REML criterion at convergence: -29.6
Scaled residuals:
Min 1Q Median 3Q Max
-1.71364 -0.74817 -0.06341 0.60227 2.13813
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002785 0.05277
Residual 0.022713 0.15071
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.57323 0.05311 7.72575 10.792 6.25e-06 ***
OriginTransplant 0.01058 0.06153 42.00000 0.172 0.8642
SiteSS 0.16334 0.06153 42.00000 2.655 0.0112 *
OriginTransplant:SiteSS -0.22488 0.08701 42.00000 -2.584 0.0133 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.579
SiteSS -0.579 0.500
OrgnTrn:SSS 0.410 -0.707 -0.707
eta_squared(Bio.S.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.12 | [0.01, 1.00]
Site | 0.03 | [0.00, 1.00]
Origin:Site | 0.14 | [0.02, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.S_TP1.res<-data.frame(summary(Bio.S.lme_TP1)$coefficients[-1,])
Bio.S_TP1.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.S_TP1.res$EtaSq<-c(eta_squared(Bio.S.lme_TP1)$Eta2)
Bio.S_TP1.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP1.res))
Effect size of Origin for each Site
##KL
Bio.S.lme_TP1_KL<-lmer(AFDW_mg.cm2_S~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="KL"),])
summary(Bio.S.lme_TP1_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "KL"), ]
REML criterion at convergence: -21.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.72868 -0.71431 0.04303 0.52737 1.90341
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.01040 0.1020
Residual 0.01508 0.1228
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.57323 0.06873 2.65466 8.340 0.00563 **
OriginTransplant 0.01058 0.05014 20.00000 0.211 0.83496
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.365
eta_squared(Bio.S.lme_TP1_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 2.22e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.S.lme_TP1_SS<-lmer(AFDW_mg.cm2_S~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="SS"),])
summary(Bio.S.lme_TP1_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "SS"), ]
REML criterion at convergence: -13.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.2456 -0.7860 -0.1378 0.6402 2.1806
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.004289 0.06549
Residual 0.023707 0.15397
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.73657 0.05836 3.90305 12.622 0.000262 ***
OriginTransplant -0.21429 0.06286 20.00000 -3.409 0.002782 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.539
eta_squared(Bio.S.lme_TP1_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.37 | [0.10, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.S_TP1.site.res<-data.frame(rbind(summary(Bio.S.lme_TP1_KL)$coefficients[-1,],
summary(Bio.S.lme_TP1_SS)$coefficients[-1,]))
Bio.S_TP1.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.S_TP1.site.res$EtaSq<-c(eta_squared(Bio.S.lme_TP1_KL)$Eta2, eta_squared(Bio.S.lme_TP1_SS)$Eta2)
Bio.S_TP1.site.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP1.site.res))
##Combine results
Bio.S_TP1.res<-rbind(Bio.S_TP1.res, Bio.S_TP1.site.res)
##Summary statistics by Site and Origin
TP1_BioSym.sum<-summarySE(Coral.TP1, measurevar="AFDW_mg.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Biomass across Treatments
TP1_BioSym.plot<-ggplot(TP1_BioSym.sum, aes(x=Site, y=AFDW_mg.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_S-se, ymax=AFDW_mg.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.45, 0.95)+
annotate("text", x=2, y=0.8, label="**", size=sig.sz, fontface="bold"); TP1_BioSym.plot
##Check normality
hist(Coral.TP1$Chl_ug.cm2)
shapiro.test(Coral.TP1$Chl_ug.cm2)
Shapiro-Wilk normality test
data: Coral.TP1$Chl_ug.cm2
W = 0.95564, p-value = 0.06727
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Chl.lme_TP1<-lmer(Chl_ug.cm2~Origin*Site+(1|Genotype), data=Coral.TP1)
##Check residuals
Chl.lme_res_TP1 <- simulateResiduals(fittedModel = Chl.lme_TP1, plot = F)
plot(Chl.lme_res_TP1)
##Model results
summary(Chl.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl_ug.cm2 ~ Origin * Site + (1 | Genotype)
Data: Coral.TP1
REML criterion at convergence: -0.4
Scaled residuals:
Min 1Q Median 3Q Max
-2.1377 -0.5871 -0.1548 0.6976 2.0162
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.08669 0.2944
Residual 0.03936 0.1984
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.86074 0.17937 2.34405 4.799 0.029564 *
OriginTransplant 0.07568 0.08099 42.00000 0.934 0.355451
SiteSS 0.54382 0.08099 42.00000 6.715 3.73e-08 ***
OriginTransplant:SiteSS -0.48115 0.11454 42.00000 -4.201 0.000136 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.226
SiteSS -0.226 0.500
OrgnTrn:SSS 0.160 -0.707 -0.707
eta_squared(Chl.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.16 | [0.03, 1.00]
Site | 0.40 | [0.21, 1.00]
Origin:Site | 0.30 | [0.12, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Chl_TP1.res<-data.frame(summary(Chl.lme_TP1)$coefficients[-1,])
Chl_TP1.res$Predictor<-c("Origin", "Site", "Origin x Site")
Chl_TP1.res$EtaSq<-c(eta_squared(Chl.lme_TP1)$Eta2)
Chl_TP1.res$Response<-rep("Chlorophyll", nrow(Chl_TP1.res))
Effect size of Origin for each Site
##KL
Chl.lme_TP1_KL<-lmer(Chl_ug.cm2~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="KL"),])
summary(Chl.lme_TP1_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl_ug.cm2 ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "KL"), ]
REML criterion at convergence: -4.9
Scaled residuals:
Min 1Q Median 3Q Max
-1.42282 -0.68856 0.00126 0.53926 2.32168
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.05037 0.2244
Residual 0.02931 0.1712
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.86074 0.13868 2.27932 6.207 0.018 *
OriginTransplant 0.07568 0.06989 20.00000 1.083 0.292
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.252
eta_squared(Chl.lme_TP1_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.06 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Chl.lme_TP1_SS<-lmer(Chl_ug.cm2~Origin+(1|Genotype), data=Coral.TP1[which(Coral.TP1$Site=="SS"),])
summary(Chl.lme_TP1_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl_ug.cm2 ~ Origin + (1 | Genotype)
Data: Coral.TP1[which(Coral.TP1$Site == "SS"), ]
REML criterion at convergence: 2.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.0949 -0.5799 0.1160 0.6297 1.7750
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.13767 0.3710
Residual 0.03874 0.1968
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.40456 0.22163 2.13798 6.338 0.0203 *
OriginTransplant -0.40548 0.08035 20.00000 -5.046 6.18e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.181
eta_squared(Chl.lme_TP1_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.56 | [0.30, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Chl_TP1.site.res<-data.frame(rbind(summary(Chl.lme_TP1_KL)$coefficients[-1,],
summary(Chl.lme_TP1_SS)$coefficients[-1,]))
Chl_TP1.site.res$Predictor<-c("KL Origin", "SS Origin")
Chl_TP1.site.res$EtaSq<-c(eta_squared(Chl.lme_TP1_KL)$Eta2, eta_squared(Chl.lme_TP1_SS)$Eta2)
Chl_TP1.site.res$Response<-rep("Chlorophyll", nrow(Chl_TP1.site.res))
##Combine results
Chl_TP1.res<-rbind(Chl_TP1.res, Chl_TP1.site.res)
##Summary statistics by Site and Origin
TP1_Chl.sum<-summarySE(Coral.TP1, measurevar="Chl_ug.cm2", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Chlorophyll across Treatments
TP1_Chl.plot<-ggplot(TP1_Chl.sum, aes(x=Site, y=Chl_ug.cm2, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl_ug.cm2-se, ymax=Chl_ug.cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Total Chlorophyll (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(0.5, 3.25)+
annotate("text", x=2, y=1.7, label="***", size=sig.sz, fontface="bold"); TP1_Chl.plot
##Combine Results
Phys_T1.res<-rbind(Prot.C_TP1.res, Prot.S_TP1.res, Bio.C_TP1.res, Bio.S_TP1.res, Chl_TP1.res)
##Add Timepoint
Phys_T1.res$TimeP<-rep("TP1", nrow(Phys_T1.res))
##Subset Timepoint 2
Coral.TP2<-subset(Coral.rm, TimeP=="TP2")
##Check normality
hist(Coral.TP2$TP_ug.cm2_C)
shapiro.test(Coral.TP2$TP_ug.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP2$TP_ug.cm2_C
W = 0.9796, p-value = 0.562
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.C.lme_TP2<-lmer(TP_ug.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP2)
##Check residuals
Prot.C.lme_res_TP2 <- simulateResiduals(fittedModel = Prot.C.lme_TP2, plot = F)
plot(Prot.C.lme_res_TP2)
##Model results
summary(Prot.C.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP2
REML criterion at convergence: 469.4
Scaled residuals:
Min 1Q Median 3Q Max
-2.67310 -0.67673 -0.00324 0.57592 1.67096
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 391.9 19.80
Residual 1877.0 43.32
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 315.853 16.942 5.593 18.643 3e-06 ***
OriginTransplant -1.965 17.687 42.000 -0.111 0.9121
SiteSS 42.263 17.687 42.000 2.389 0.0214 *
OriginTransplant:SiteSS 8.579 25.013 42.000 0.343 0.7333
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.522
SiteSS -0.522 0.500
OrgnTrn:SSS 0.369 -0.707 -0.707
eta_squared(Prot.C.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 8.22e-04 | [0.00, 1.00]
Site | 0.25 | [0.08, 1.00]
Origin:Site | 2.79e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.C_TP2.res<-data.frame(summary(Prot.C.lme_TP2)$coefficients[-1,])
Prot.C_TP2.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.C_TP2.res$EtaSq<-c(eta_squared(Prot.C.lme_TP2)$Eta2)
Prot.C_TP2.res$Response<-rep("Protein Host", nrow(Prot.C_TP2.res))
##Check normality
hist(Coral.TP2$TP_ug.cm2_S)
shapiro.test(Coral.TP2$TP_ug.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP2$TP_ug.cm2_S
W = 0.95982, p-value = 0.09929
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.S.lme_TP2<-lmer(TP_ug.cm2_S~Origin*Site+(1|Genotype), data=Coral.TP2)
##Check residuals
Prot.S.lme_res_TP2 <- simulateResiduals(fittedModel = Prot.S.lme_TP2, plot = F)
plot(Prot.S.lme_res_TP2)
##Model results
summary(Prot.S.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin * Site + (1 | Genotype)
Data: Coral.TP2
REML criterion at convergence: 493.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.5114 -0.6809 -0.1247 0.6145 2.6570
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 796.1 28.22
Residual 3198.1 56.55
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 329.068 23.062 5.046 14.269 2.85e-05 ***
OriginTransplant -29.475 23.087 42.000 -1.277 0.209
SiteSS 43.245 23.087 42.000 1.873 0.068 .
OriginTransplant:SiteSS 35.173 32.650 42.000 1.077 0.288
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.501
SiteSS -0.501 0.500
OrgnTrn:SSS 0.354 -0.707 -0.707
eta_squared(Prot.S.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.01 | [0.00, 1.00]
Site | 0.25 | [0.08, 1.00]
Origin:Site | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.S_TP2.res<-data.frame(summary(Prot.S.lme_TP2)$coefficients[-1,])
Prot.S_TP2.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.S_TP2.res$EtaSq<-c(eta_squared(Prot.S.lme_TP2)$Eta2)
Prot.S_TP2.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP2.res))
Effect size of Origin for each Site
##KL
Prot.S.lme_TP2_KL<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="KL"),])
summary(Prot.S.lme_TP2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "KL"), ]
REML criterion at convergence: 238.6
Scaled residuals:
Min 1Q Median 3Q Max
-1.4406 -0.8006 0.2111 0.5424 1.7322
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 688.7 26.24
Residual 2134.1 46.20
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 329.068 20.185 3.247 16.303 0.000316 ***
OriginTransplant -29.475 18.860 20.000 -1.563 0.133770
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.467
eta_squared(Prot.S.lme_TP2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.11 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Prot.S.lme_TP2_SS<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="SS"),])
summary(Prot.S.lme_TP2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "SS"), ]
REML criterion at convergence: 251.8
Scaled residuals:
Min 1Q Median 3Q Max
-1.3034 -0.8616 0.0128 0.6244 2.1515
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 1484 38.53
Residual 3840 61.96
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 372.313 28.545 3.078 13.043 0.000854 ***
OriginTransplant 5.698 25.297 20.000 0.225 0.824065
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.443
eta_squared(Prot.S.lme_TP2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 2.53e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Prot.S_TP2.site.res<-data.frame(rbind(summary(Prot.S.lme_TP2_KL)$coefficients[-1,],
summary(Prot.S.lme_TP2_SS)$coefficients[-1,]))
Prot.S_TP2.site.res$Predictor<-c("KL Origin", "SS Origin")
Prot.S_TP2.site.res$EtaSq<-c(eta_squared(Prot.S.lme_TP2_KL)$Eta2, eta_squared(Prot.S.lme_TP2_SS)$Eta2)
Prot.S_TP2.site.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP2.site.res))
##Combine results
Prot.S_TP2.res<-rbind(Prot.S_TP2.res, Prot.S_TP2.site.res)
##Summary statistics by Site and Origin
TP2_ProtSym.sum<-summarySE(Coral.TP2, measurevar="TP_ug.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Protein across Treatments
TP2_ProtSym.plot<-ggplot(TP2_ProtSym.sum, aes(x=Site, y=TP_ug.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=TP_ug.cm2_S-se, ymax=TP_ug.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Protein (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(250, 550); TP2_ProtSym.plot
##Check normality
hist(Coral.TP2$AFDW_mg.cm2_C)
shapiro.test(Coral.TP2$AFDW_mg.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP2$AFDW_mg.cm2_C
W = 0.98545, p-value = 0.8093
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.C.lme_TP2<-lmer(AFDW_mg.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP2)
##Check residuals
Bio.C.lme_res_TP2 <- simulateResiduals(fittedModel = Bio.C.lme_TP2, plot = F)
plot(Bio.C.lme_res_TP2)
##Model results
summary(Bio.C.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP2
REML criterion at convergence: -19.7
Scaled residuals:
Min 1Q Median 3Q Max
-3.2645 -0.4732 -0.0846 0.5858 2.5448
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002429 0.04928
Residual 0.028719 0.16947
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.16312 0.05659 9.60683 20.552 2.91e-09 ***
OriginTransplant -0.10184 0.06918 42.00000 -1.472 0.1485
SiteSS -0.11111 0.06918 42.00000 -1.606 0.1158
OriginTransplant:SiteSS 0.26062 0.09784 42.00000 2.664 0.0109 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.611
SiteSS -0.611 0.500
OrgnTrn:SSS 0.432 -0.707 -0.707
eta_squared(Bio.C.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 8.00e-03 | [0.00, 1.00]
Site | 3.65e-03 | [0.00, 1.00]
Origin:Site | 0.14 | [0.02, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.C_TP2.res<-data.frame(summary(Bio.C.lme_TP2)$coefficients[-1,])
Bio.C_TP2.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.C_TP2.res$EtaSq<-c(eta_squared(Bio.C.lme_TP2)$Eta2)
Bio.C_TP2.res$Response<-rep("Biomass Host", nrow(Bio.C_TP2.res))
Effect size of Origin for each Site
##KL
Bio.C.lme_TP2_KL<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="KL"),])
summary(Bio.C.lme_TP2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "KL"), ]
REML criterion at convergence: -14.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.7100 -0.5598 -0.2566 0.3597 2.9272
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.001355 0.03681
Residual 0.023645 0.15377
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.16312 0.04921 5.42756 23.634 1.11e-06 ***
OriginTransplant -0.10184 0.06278 20.00000 -1.622 0.12
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.638
eta_squared(Bio.C.lme_TP2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.12 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.C.lme_TP2_SS<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="SS"),])
boundary (singular) fit: see help('isSingular')
summary(Bio.C.lme_TP2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "SS"), ]
REML criterion at convergence: -5.5
Scaled residuals:
Min 1Q Median 3Q Max
-3.0676 -0.4964 0.1545 0.7280 1.2050
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.00000 0.0000
Residual 0.03634 0.1906
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.05201 0.05503 22.00000 19.12 3.42e-15 ***
OriginTransplant 0.15878 0.07783 22.00000 2.04 0.0535 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Bio.C.lme_TP2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.16 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.C_TP2.site.res<-data.frame(rbind(summary(Bio.C.lme_TP2_KL)$coefficients[-1,],
summary(Bio.C.lme_TP2_SS)$coefficients[-1,]))
Bio.C_TP2.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.C_TP2.site.res$EtaSq<-c(eta_squared(Bio.C.lme_TP2_KL)$Eta2, eta_squared(Bio.C.lme_TP2_SS)$Eta2)
Bio.C_TP2.site.res$Response<-rep("Biomass Host", nrow(Bio.C_TP2.site.res))
##Combine results
Bio.C_TP2.res<-rbind(Bio.C_TP2.res, Bio.C_TP2.site.res)
##Summary statistics by Site and Origin
TP2_BioHost.sum<-summarySE(Coral.TP2, measurevar="AFDW_mg.cm2_C", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Host Biomass across Treatments
TP2_BioHost.plot<-ggplot(TP2_BioHost.sum, aes(x=Site, y=AFDW_mg.cm2_C, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_C-se, ymax=AFDW_mg.cm2_C+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Host Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.8, 1.6)+
annotate("text", x=2, y=1.35, label="-", size=levels.sz, fontface="bold"); TP2_BioHost.plot
##Check normality
hist(Coral.TP2$AFDW_mg.cm2_S)
shapiro.test(Coral.TP2$AFDW_mg.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP2$AFDW_mg.cm2_S
W = 0.98263, p-value = 0.6911
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.S.lme_TP2<-lmer(AFDW_mg.cm2_S~Origin*Site+(1|Genotype), data=Coral.TP2)
##Check residuals
Bio.S.lme_res_TP2 <- simulateResiduals(fittedModel = Bio.S.lme_TP2, plot = F)
plot(Bio.S.lme_res_TP2)
##Model results
summary(Bio.S.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin * Site + (1 | Genotype)
Data: Coral.TP2
REML criterion at convergence: -50.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.89274 -0.61267 -0.05248 0.62439 1.64962
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0003874 0.01968
Residual 0.0146825 0.12117
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.71562 0.03678 15.95638 19.457 1.54e-12 ***
OriginTransplant -0.12045 0.04947 42.00000 -2.435 0.0192 *
SiteSS 0.12854 0.04947 42.00000 2.599 0.0129 *
OriginTransplant:SiteSS 0.11020 0.06996 42.00000 1.575 0.1227
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.673
SiteSS -0.673 0.500
OrgnTrn:SSS 0.476 -0.707 -0.707
eta_squared(Bio.S.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.08 | [0.00, 1.00]
Site | 0.40 | [0.21, 1.00]
Origin:Site | 0.06 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.S_TP2.res<-data.frame(summary(Bio.S.lme_TP2)$coefficients[-1,])
Bio.S_TP2.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.S_TP2.res$EtaSq<-c(eta_squared(Bio.S.lme_TP2)$Eta2)
Bio.S_TP2.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP2.res))
Effect size of Origin for each Site
##KL
Bio.S.lme_TP2_KL<-lmer(AFDW_mg.cm2_S~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="KL"),])
boundary (singular) fit: see help('isSingular')
summary(Bio.S.lme_TP2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "KL"), ]
REML criterion at convergence: -25.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.7872 -0.5807 -0.0580 0.6095 1.5698
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.00000 0.0000
Residual 0.01486 0.1219
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.71562 0.03519 22.00000 20.34 9.41e-16 ***
OriginTransplant -0.12045 0.04977 22.00000 -2.42 0.0242 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Bio.S.lme_TP2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.21 | [0.02, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.S.lme_TP2_SS<-lmer(AFDW_mg.cm2_S~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="SS"),])
summary(Bio.S.lme_TP2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "SS"), ]
REML criterion at convergence: -27.9
Scaled residuals:
Min 1Q Median 3Q Max
-1.7098 -0.5388 -0.1840 0.6014 1.8524
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.004978 0.07056
Residual 0.011447 0.10699
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.84416 0.05112 2.97784 16.513 0.000504 ***
OriginTransplant -0.01025 0.04368 20.00000 -0.235 0.816917
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.427
eta_squared(Bio.S.lme_TP2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 2.74e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.S_TP2.site.res<-data.frame(rbind(summary(Bio.S.lme_TP2_KL)$coefficients[-1,],
summary(Bio.S.lme_TP2_SS)$coefficients[-1,]))
Bio.S_TP2.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.S_TP2.site.res$EtaSq<-c(eta_squared(Bio.S.lme_TP2_KL)$Eta2, eta_squared(Bio.S.lme_TP2_SS)$Eta2)
Bio.S_TP2.site.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP2.site.res))
##Combine results
Bio.S_TP2.res<-rbind(Bio.S_TP2.res, Bio.S_TP2.site.res)
##Summary statistics by Site and Origin
TP2_BioSym.sum<-summarySE(Coral.TP2, measurevar="AFDW_mg.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Biomass across Treatments
TP2_BioSym.plot<-ggplot(TP2_BioSym.sum, aes(x=Site, y=AFDW_mg.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_S-se, ymax=AFDW_mg.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position= "top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.45, 0.95)+
annotate("text", x=1, y=0.78, label="*", size=sig.sz, fontface="bold"); TP2_BioSym.plot
##Check normality
hist(Coral.TP2$Chl_ug.cm2)
shapiro.test(Coral.TP2$Chl_ug.cm2)
Shapiro-Wilk normality test
data: Coral.TP2$Chl_ug.cm2
W = 0.89322, p-value = 0.0003826
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Chl.lme_TP2<-lmer(Chl_ug.cm2~Origin*Site+(1|Genotype), data=Coral.TP2)
##Check residuals
Chl.lme_res_TP2 <- simulateResiduals(fittedModel = Chl.lme_TP2, plot = F)
plot(Chl.lme_res_TP2)
##Model results
summary(Chl.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl_ug.cm2 ~ Origin * Site + (1 | Genotype)
Data: Coral.TP2
REML criterion at convergence: 60.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.5646 -0.6834 -0.2260 0.6331 2.9227
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.02999 0.1732
Residual 0.17246 0.4153
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.2824 0.1561 6.2441 8.216 0.000142 ***
OriginTransplant -0.2475 0.1695 42.0000 -1.460 0.151795
SiteSS 0.5567 0.1695 42.0000 3.284 0.002071 **
OriginTransplant:SiteSS 0.6593 0.2398 42.0000 2.750 0.008761 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.543
SiteSS -0.543 0.500
OrgnTrn:SSS 0.384 -0.707 -0.707
eta_squared(Chl.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.01 | [0.00, 1.00]
Site | 0.57 | [0.40, 1.00]
Origin:Site | 0.15 | [0.02, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Chl_TP2.res<-data.frame(summary(Chl.lme_TP2)$coefficients[-1,])
Chl_TP2.res$Predictor<-c("Origin", "Site", "Origin x Site")
Chl_TP2.res$EtaSq<-c(eta_squared(Chl.lme_TP2)$Eta2)
Chl_TP2.res$Response<-rep("Chlorophyll", nrow(Chl_TP2.res))
Effect size of Origin for each Site
##KL
Chl.lme_TP2_KL<-lmer(Chl_ug.cm2~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="KL"),])
summary(Chl.lme_TP2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl_ug.cm2 ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "KL"), ]
REML criterion at convergence: 4.9
Scaled residuals:
Min 1Q Median 3Q Max
-1.4118 -0.7633 -0.1784 0.6717 2.0082
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.01088 0.1043
Residual 0.05353 0.2314
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.28244 0.08993 3.75836 14.26 0.000207 ***
OriginTransplant -0.24748 0.09445 20.00000 -2.62 0.016394 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.525
eta_squared(Chl.lme_TP2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.26 | [0.03, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Chl.lme_TP2_SS<-lmer(Chl_ug.cm2~Origin+(1|Genotype), data=Coral.TP2[which(Coral.TP2$Site=="SS"),])
summary(Chl.lme_TP2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl_ug.cm2 ~ Origin + (1 | Genotype)
Data: Coral.TP2[which(Coral.TP2$Site == "SS"), ]
REML criterion at convergence: 36.7
Scaled residuals:
Min 1Q Median 3Q Max
-1.2515 -0.7498 -0.1994 0.6152 2.0640
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.1653 0.4065
Residual 0.2069 0.4548
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.8391 0.2689 2.5731 6.838 0.0103 *
OriginTransplant 0.4118 0.1857 20.0000 2.218 0.0383 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.345
eta_squared(Chl.lme_TP2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.20 | [0.01, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Chl_TP2.site.res<-data.frame(rbind(summary(Chl.lme_TP2_KL)$coefficients[-1,],
summary(Chl.lme_TP2_SS)$coefficients[-1,]))
Chl_TP2.site.res$Predictor<-c("KL Origin", "SS Origin")
Chl_TP2.site.res$EtaSq<-c(eta_squared(Chl.lme_TP2_KL)$Eta2, eta_squared(Chl.lme_TP2_SS)$Eta2)
Chl_TP2.site.res$Response<-rep("Chlorophyll", nrow(Chl_TP2.site.res))
##Combine results
Chl_TP2.res<-rbind(Chl_TP2.res, Chl_TP2.site.res)
##Summary statistics by Site and Origin
TP2_Chl.sum<-summarySE(Coral.TP2, measurevar="Chl_ug.cm2", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Chlorophyll across Treatments
TP2_Chl.plot<-ggplot(TP2_Chl.sum, aes(x=Site, y=Chl_ug.cm2, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl_ug.cm2-se, ymax=Chl_ug.cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position= "top")+
labs(x="Site and Origin", y=expression(paste('Total Chlorophyll (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(0.5, 3.25)+
annotate("text", x=c(1,2), y=c(1.5, 2.6), label="*", size=sig.sz, fontface="bold"); TP2_Chl.plot
##Combine Results
Phys_T2.res<-rbind(Prot.C_TP2.res, Prot.S_TP2.res, Bio.C_TP2.res, Bio.S_TP2.res, Chl_TP2.res)
##Add Timepoint
Phys_T2.res$TimeP<-rep("TP2", nrow(Phys_T2.res))
##Subset Timepoint 3
Coral.TP3<-subset(Coral.rm, TimeP=="TP3")
##Check normality
hist(Coral.TP3$TP_ug.cm2_C)
shapiro.test(Coral.TP3$TP_ug.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP3$TP_ug.cm2_C
W = 0.97395, p-value = 0.3582
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.C.lme_TP3<-lmer(TP_ug.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP3)
##Check residuals
Prot.C.lme_res_TP3 <- simulateResiduals(fittedModel = Prot.C.lme_TP3, plot = F)
plot(Prot.C.lme_res_TP3)
##Model results
summary(Prot.C.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP3
REML criterion at convergence: 507.3
Scaled residuals:
Min 1Q Median 3Q Max
-2.52281 -0.56107 -0.09932 0.69343 2.85970
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 1765 42.01
Residual 4332 65.82
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 354.577 30.812 3.885 11.508 0.000382 ***
OriginTransplant -28.338 26.869 42.000 -1.055 0.297608
SiteSS 11.510 26.869 42.000 0.428 0.670560
OriginTransplant:SiteSS 6.695 37.999 42.000 0.176 0.861001
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.436
SiteSS -0.436 0.500
OrgnTrn:SSS 0.308 -0.707 -0.707
eta_squared(Prot.C.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.04 | [0.00, 1.00]
Site | 0.01 | [0.00, 1.00]
Origin:Site | 7.38e-04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.C_TP3.res<-data.frame(summary(Prot.C.lme_TP3)$coefficients[-1,])
Prot.C_TP3.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.C_TP3.res$EtaSq<-c(eta_squared(Prot.C.lme_TP3)$Eta2)
Prot.C_TP3.res$Response<-rep("Protein Host", nrow(Prot.C_TP3.res))
##Check normality
hist(Coral.TP3$TP_ug.cm2_S)
shapiro.test(Coral.TP3$TP_ug.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP3$TP_ug.cm2_S
W = 0.95992, p-value = 0.1002
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.S.lme_TP3<-lmer(TP_ug.cm2_S~Origin*Site+(1|Genotype), data=Coral.TP3)
##Check residuals
Prot.S.lme_res_TP3 <- simulateResiduals(fittedModel = Prot.S.lme_TP3, plot = F)
plot(Prot.S.lme_res_TP3)
##Model results
summary(Prot.S.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin * Site + (1 | Genotype)
Data: Coral.TP3
REML criterion at convergence: 497.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.04853 -0.63564 -0.04301 0.40723 2.41329
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 606.5 24.63
Residual 3588.9 59.91
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 350.037 22.388 6.353 15.635 2.61e-06 ***
OriginTransplant -31.070 24.457 42.000 -1.270 0.211
SiteSS 54.236 24.457 42.000 2.218 0.032 *
OriginTransplant:SiteSS 40.425 34.588 42.000 1.169 0.249
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.546
SiteSS -0.546 0.500
OrgnTrn:SSS 0.386 -0.707 -0.707
eta_squared(Prot.S.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 9.30e-03 | [0.00, 1.00]
Site | 0.31 | [0.13, 1.00]
Origin:Site | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.S_TP3.res<-data.frame(summary(Prot.S.lme_TP3)$coefficients[-1,])
Prot.S_TP3.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.S_TP3.res$EtaSq<-c(eta_squared(Prot.S.lme_TP3)$Eta2)
Prot.S_TP3.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP3.res))
Effect size of Origin for each Site
##KL
Prot.S.lme_TP3_KL<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="KL"),])
summary(Prot.S.lme_TP3_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "KL"), ]
REML criterion at convergence: 240.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.73973 -0.61677 -0.06905 0.34373 2.28780
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 267.5 16.36
Residual 2444.8 49.45
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 350.037 17.114 4.572 20.453 1.14e-05 ***
OriginTransplant -31.070 20.186 20.000 -1.539 0.139
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.590
eta_squared(Prot.S.lme_TP3_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.11 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Prot.S.lme_TP3_SS<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="SS"),])
summary(Prot.S.lme_TP3_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "SS"), ]
REML criterion at convergence: 255.5
Scaled residuals:
Min 1Q Median 3Q Max
-1.80428 -0.53697 0.01298 0.48663 2.22260
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 939.7 30.66
Residual 4737.1 68.83
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 404.272 26.608 3.788 15.193 0.000156 ***
OriginTransplant 9.355 28.098 20.000 0.333 0.742643
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.528
eta_squared(Prot.S.lme_TP3_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 5.51e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Prot.S_TP3.site.res<-data.frame(rbind(summary(Prot.S.lme_TP3_KL)$coefficients[-1,],
summary(Prot.S.lme_TP3_SS)$coefficients[-1,]))
Prot.S_TP3.site.res$Predictor<-c("KL Origin", "SS Origin")
Prot.S_TP3.site.res$EtaSq<-c(eta_squared(Prot.S.lme_TP3_KL)$Eta2, eta_squared(Prot.S.lme_TP3_SS)$Eta2)
Prot.S_TP3.site.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP3.site.res))
##Combine results
Prot.S_TP3.res<-rbind(Prot.S_TP3.res, Prot.S_TP3.site.res)
##Summary statistics by Site and Origin
TP3_ProtSym.sum<-summarySE(Coral.TP3, measurevar="TP_ug.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Protein across Treatments
TP3_ProtSym.plot<-ggplot(TP3_ProtSym.sum, aes(x=Site, y=TP_ug.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=TP_ug.cm2_S-se, ymax=TP_ug.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Protein (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(250, 550); TP3_ProtSym.plot
##Check normality
hist(Coral.TP3$AFDW_mg.cm2_C)
shapiro.test(Coral.TP3$AFDW_mg.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP3$AFDW_mg.cm2_C
W = 0.98042, p-value = 0.5962
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.C.lme_TP3<-lmer(AFDW_mg.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP3)
##Check residuals
Bio.C.lme_res_TP3 <- simulateResiduals(fittedModel = Bio.C.lme_TP3, plot = F)
plot(Bio.C.lme_res_TP3)
##Model results
summary(Bio.C.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP3
REML criterion at convergence: 1.8
Scaled residuals:
Min 1Q Median 3Q Max
-2.39331 -0.54299 0.06699 0.61611 2.15929
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.007168 0.08467
Residual 0.045972 0.21441
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.18826 0.07887 6.67318 15.066 2.12e-06 ***
OriginTransplant -0.12291 0.08753 42.00000 -1.404 0.168
SiteSS 0.09539 0.08753 42.00000 1.090 0.282
OriginTransplant:SiteSS 0.12089 0.12379 42.00000 0.977 0.334
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.555
SiteSS -0.555 0.500
OrgnTrn:SSS 0.392 -0.707 -0.707
eta_squared(Bio.C.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.02 | [0.00, 1.00]
Site | 0.13 | [0.01, 1.00]
Origin:Site | 0.02 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.C_TP3.res<-data.frame(summary(Bio.C.lme_TP3)$coefficients[-1,])
Bio.C_TP3.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.C_TP3.res$EtaSq<-c(eta_squared(Bio.C.lme_TP3)$Eta2)
Bio.C_TP3.res$Response<-rep("Biomass Host", nrow(Bio.C_TP3.res))
Effect size of Origin for each Site
##KL
Bio.C.lme_TP3_KL<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="KL"),])
summary(Bio.C.lme_TP3_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "KL"), ]
REML criterion at convergence: 4.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.11835 -0.65919 -0.03638 0.66514 2.01105
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002671 0.05168
Residual 0.055878 0.23638
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.18826 0.07448 5.64458 15.955 6.53e-06 ***
OriginTransplant -0.12291 0.09650 20.00000 -1.274 0.217
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.648
eta_squared(Bio.C.lme_TP3_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.08 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.C.lme_TP3_SS<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="SS"),])
summary(Bio.C.lme_TP3_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "SS"), ]
REML criterion at convergence: -1.9
Scaled residuals:
Min 1Q Median 3Q Max
-1.92899 -0.46522 0.05763 0.57468 2.06374
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.006692 0.0818
Residual 0.039684 0.1992
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.283651 0.074415 3.992959 17.250 6.71e-05 ***
OriginTransplant -0.002024 0.081326 20.000004 -0.025 0.98
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.546
eta_squared(Bio.C.lme_TP3_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 3.10e-05 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.C_TP3.site.res<-data.frame(rbind(summary(Bio.C.lme_TP3_KL)$coefficients[-1,],
summary(Bio.C.lme_TP3_SS)$coefficients[-1,]))
Bio.C_TP3.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.C_TP3.site.res$EtaSq<-c(eta_squared(Bio.C.lme_TP3_KL)$Eta2, eta_squared(Bio.C.lme_TP3_SS)$Eta2)
Bio.C_TP3.site.res$Response<-rep("Biomass Host", nrow(Bio.C_TP3.site.res))
##Combine results
Bio.C_TP3.res<-rbind(Bio.C_TP3.res, Bio.C_TP3.site.res)
##Summary statistics by Site and Origin
TP3_BioHost.sum<-summarySE(Coral.TP3, measurevar="AFDW_mg.cm2_C", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Host Biomass across Treatments
TP3_BioHost.plot<-ggplot(TP3_BioHost.sum, aes(x=Site, y=AFDW_mg.cm2_C, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_C-se, ymax=AFDW_mg.cm2_C+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Host Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.8, 1.6); TP3_BioHost.plot
##Check normality
hist(Coral.TP3$AFDW_mg.cm2_S)
shapiro.test(Coral.TP3$AFDW_mg.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP3$AFDW_mg.cm2_S
W = 0.95017, p-value = 0.04062
#Slightly non Normal
hist(log(Coral.TP3$AFDW_mg.cm2_S+1))
shapiro.test(log(Coral.TP3$AFDW_mg.cm2_S+1))
Shapiro-Wilk normality test
data: log(Coral.TP3$AFDW_mg.cm2_S + 1)
W = 0.97082, p-value = 0.2726
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.S.lme_TP3<-lmer(log(AFDW_mg.cm2_S+1)~Origin*Site+(1|Genotype), data=Coral.TP3)
##Check residuals
Bio.S.lme_res_TP3 <- simulateResiduals(fittedModel = Bio.S.lme_TP3, plot = F)
plot(Bio.S.lme_res_TP3)
##Model results
summary(Bio.S.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(AFDW_mg.cm2_S + 1) ~ Origin * Site + (1 | Genotype)
Data: Coral.TP3
REML criterion at convergence: -59.8
Scaled residuals:
Min 1Q Median 3Q Max
-1.9013 -0.6371 -0.1087 0.6759 2.0985
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.001717 0.04143
Residual 0.011351 0.10654
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.50341 0.03896 6.79866 12.920 4.92e-06 ***
OriginTransplant -0.02185 0.04349 42.00000 -0.502 0.6180
SiteSS 0.07684 0.04349 42.00000 1.767 0.0845 .
OriginTransplant:SiteSS 0.04053 0.06151 42.00000 0.659 0.5136
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.558
SiteSS -0.558 0.500
OrgnTrn:SSS 0.395 -0.707 -0.707
eta_squared(Bio.S.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 6.34e-05 | [0.00, 1.00]
Site | 0.19 | [0.04, 1.00]
Origin:Site | 0.01 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.S_TP3.res<-data.frame(summary(Bio.S.lme_TP3)$coefficients[-1,])
Bio.S_TP3.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.S_TP3.res$EtaSq<-c(eta_squared(Bio.S.lme_TP3)$Eta2)
Bio.S_TP3.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP3.res))
Effect size of Origin for each Site
##KL
Bio.S.lme_TP3_KL<-lmer(log(AFDW_mg.cm2_S+1)~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="KL"),])
summary(Bio.S.lme_TP3_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(AFDW_mg.cm2_S + 1) ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "KL"), ]
REML criterion at convergence: -32.8
Scaled residuals:
Min 1Q Median 3Q Max
-2.19334 -0.63480 -0.09404 0.31252 2.01340
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.001809 0.04253
Residual 0.009689 0.09843
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.50341 0.03755 3.86356 13.405 0.000221 ***
OriginTransplant -0.02185 0.04018 20.00000 -0.544 0.592623
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.535
eta_squared(Bio.S.lme_TP3_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.01 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.S.lme_TP3_SS<-lmer(log(AFDW_mg.cm2_S+1)~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="SS"),])
summary(Bio.S.lme_TP3_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(AFDW_mg.cm2_S + 1) ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "SS"), ]
REML criterion at convergence: -26.4
Scaled residuals:
Min 1Q Median 3Q Max
-1.70864 -0.59241 -0.00109 0.59598 2.08623
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0008163 0.02857
Residual 0.0136003 0.11662
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.58025 0.03749 5.37009 15.478 1.16e-05 ***
OriginTransplant 0.01868 0.04761 20.00000 0.392 0.699
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.635
eta_squared(Bio.S.lme_TP3_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 7.63e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.S_TP3.site.res<-data.frame(rbind(summary(Bio.S.lme_TP3_KL)$coefficients[-1,],
summary(Bio.S.lme_TP3_SS)$coefficients[-1,]))
Bio.S_TP3.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.S_TP3.site.res$EtaSq<-c(eta_squared(Bio.S.lme_TP3_KL)$Eta2, eta_squared(Bio.S.lme_TP3_SS)$Eta2)
Bio.S_TP3.site.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP3.site.res))
##Combine results
Bio.S_TP3.res<-rbind(Bio.S_TP3.res, Bio.S_TP3.site.res)
##Summary statistics by Site and Origin
TP3_BioSym.sum<-summarySE(Coral.TP3, measurevar="AFDW_mg.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Biomass across Treatments
TP3_BioSym.plot<-ggplot(TP3_BioSym.sum, aes(x=Site, y=AFDW_mg.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_S-se, ymax=AFDW_mg.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.45, 0.95); TP3_BioSym.plot
##Check normality
hist(Coral.TP3$Chl_ug.cm2)
shapiro.test(Coral.TP3$Chl_ug.cm2)
Shapiro-Wilk normality test
data: Coral.TP3$Chl_ug.cm2
W = 0.92502, p-value = 0.004491
#Not normal
hist(log(Coral.TP3$Chl_ug.cm2+1))
shapiro.test(log(Coral.TP3$Chl_ug.cm2+1))
Shapiro-Wilk normality test
data: log(Coral.TP3$Chl_ug.cm2 + 1)
W = 0.97477, p-value = 0.3837
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Chl.lme_TP3<-lmer(log(Chl_ug.cm2+1)~Origin*Site+(1|Genotype), data=Coral.TP3)
##Check residuals
Chl.lme_res_TP3 <- simulateResiduals(fittedModel = Chl.lme_TP3, plot = F)
plot(Chl.lme_res_TP3)
##Model results
summary(Chl.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl_ug.cm2 + 1) ~ Origin * Site + (1 | Genotype)
Data: Coral.TP3
REML criterion at convergence: -35.4
Scaled residuals:
Min 1Q Median 3Q Max
-2.25062 -0.55117 -0.02076 0.43420 2.75244
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.01951 0.1397
Residual 0.01831 0.1353
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.81996 0.08960 2.71679 9.151 0.00406 **
OriginTransplant -0.10476 0.05525 42.00000 -1.896 0.06483 .
SiteSS 0.18045 0.05525 42.00000 3.266 0.00217 **
OriginTransplant:SiteSS 0.13664 0.07813 42.00000 1.749 0.08761 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.308
SiteSS -0.308 0.500
OrgnTrn:SSS 0.218 -0.707 -0.707
eta_squared(Chl.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.02 | [0.00, 1.00]
Site | 0.49 | [0.31, 1.00]
Origin:Site | 0.07 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Chl_TP3.res<-data.frame(summary(Chl.lme_TP3)$coefficients[-1,])
Chl_TP3.res$Predictor<-c("Origin", "Site", "Origin x Site")
Chl_TP3.res$EtaSq<-c(eta_squared(Chl.lme_TP3)$Eta2)
Chl_TP3.res$Response<-rep("Chlorophyll", nrow(Chl_TP3.res))
Effect size of Origin for each Site
##KL
Chl.lme_TP3_KL<-lmer(log(Chl_ug.cm2+1)~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="KL"),])
summary(Chl.lme_TP3_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl_ug.cm2 + 1) ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "KL"), ]
REML criterion at convergence: -19
Scaled residuals:
Min 1Q Median 3Q Max
-1.7968 -0.6704 -0.2815 0.8139 2.1670
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.009698 0.09848
Residual 0.016854 0.12982
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.8200 0.0681 2.7687 12.041 0.00179 **
OriginTransplant -0.1048 0.0530 20.0000 -1.977 0.06205 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.389
eta_squared(Chl.lme_TP3_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.16 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Chl.lme_TP3_SS<-lmer(log(Chl_ug.cm2+1)~Origin+(1|Genotype), data=Coral.TP3[which(Coral.TP3$Site=="SS"),])
summary(Chl.lme_TP3_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl_ug.cm2 + 1) ~ Origin + (1 | Genotype)
Data: Coral.TP3[which(Coral.TP3$Site == "SS"), ]
REML criterion at convergence: -16.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.11066 -0.45318 -0.01187 0.63929 2.41481
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.03310 0.1819
Residual 0.01702 0.1305
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.00040 0.11159 2.24803 8.965 0.00837 **
OriginTransplant 0.03189 0.05326 20.00000 0.599 0.55610
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.239
eta_squared(Chl.lme_TP3_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.02 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Chl_TP3.site.res<-data.frame(rbind(summary(Chl.lme_TP3_KL)$coefficients[-1,],
summary(Chl.lme_TP3_SS)$coefficients[-1,]))
Chl_TP3.site.res$Predictor<-c("KL Origin", "SS Origin")
Chl_TP3.site.res$EtaSq<-c(eta_squared(Chl.lme_TP3_KL)$Eta2, eta_squared(Chl.lme_TP3_SS)$Eta2)
Chl_TP3.site.res$Response<-rep("Chlorophyll", nrow(Chl_TP3.site.res))
##Combine results
Chl_TP3.res<-rbind(Chl_TP3.res, Chl_TP3.site.res)
##Summary statistics by Site and Origin
TP3_Chl.sum<-summarySE(Coral.TP3, measurevar="Chl_ug.cm2", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Chlorophyll across Treatments
TP3_Chl.plot<-ggplot(TP3_Chl.sum, aes(x=Site, y=Chl_ug.cm2, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl_ug.cm2-se, ymax=Chl_ug.cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Total Chlorophyll (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(0.5, 3.25)+
annotate("text", x=1, y=1.5, label="-", size=levels.sz, fontface="bold"); TP3_Chl.plot
##Combine Results
Phys_T3.res<-rbind(Prot.C_TP3.res, Prot.S_TP3.res, Bio.C_TP3.res, Bio.S_TP3.res, Chl_TP3.res)
##Add Timepoint
Phys_T3.res$TimeP<-rep("TP3", nrow(Phys_T3.res))
##Subset Timepoint 4
Coral.TP4<-subset(Coral.rm, TimeP=="TP4")
##Check normality
hist(Coral.TP4$TP_ug.cm2_C)
shapiro.test(Coral.TP4$TP_ug.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP4$TP_ug.cm2_C
W = 0.97592, p-value = 0.4503
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.C.lme_TP4<-lmer(TP_ug.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP4)
##Check residuals
Prot.C.lme_res_TP4 <- simulateResiduals(fittedModel = Prot.C.lme_TP4, plot = F)
plot(Prot.C.lme_res_TP4)
##Model results
summary(Prot.C.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP4
REML criterion at convergence: 492.6
Scaled residuals:
Min 1Q Median 3Q Max
-1.82648 -0.74846 0.02454 0.66400 1.93010
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 23.74 4.872
Residual 5739.32 75.758
Number of obs: 46, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 329.20 22.05 20.43 14.930 1.86e-12 ***
OriginTransplant 21.29 31.63 40.27 0.673 0.505
SiteSS 50.44 30.93 40.12 1.631 0.111
OriginTransplant:SiteSS -67.31 44.72 40.12 -1.505 0.140
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.686
SiteSS -0.701 0.489
OrgnTrn:SSS 0.485 -0.707 -0.692
eta_squared(Prot.C.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 7.51e-03 | [0.00, 1.00]
Site | 0.01 | [0.00, 1.00]
Origin:Site | 0.05 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.C_TP4.res<-data.frame(summary(Prot.C.lme_TP4)$coefficients[-1,])
Prot.C_TP4.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.C_TP4.res$EtaSq<-c(eta_squared(Prot.C.lme_TP4)$Eta2)
Prot.C_TP4.res$Response<-rep("Protein Host", nrow(Prot.C_TP4.res))
##Check normality
hist(Coral.TP4$TP_ug.cm2_S)
shapiro.test(Coral.TP4$TP_ug.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP4$TP_ug.cm2_S
W = 0.98874, p-value = 0.9316
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Prot.S.lme_TP4<-lmer(TP_ug.cm2_S~Origin*Site+(1|Genotype), data=Coral.TP4)
##Check residuals
Prot.S.lme_res_TP4 <- simulateResiduals(fittedModel = Prot.S.lme_TP4, plot = F)
plot(Prot.S.lme_res_TP4)
##Model results
summary(Prot.S.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin * Site + (1 | Genotype)
Data: Coral.TP4
REML criterion at convergence: 464
Scaled residuals:
Min 1Q Median 3Q Max
-1.9674 -0.6915 -0.1394 0.7468 1.8746
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 258.6 16.08
Residual 2793.9 52.86
Number of obs: 46, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 283.146 17.862 8.966 15.852 7.28e-08 ***
OriginTransplant 2.715 22.078 40.118 0.123 0.903
SiteSS 94.191 21.579 40.048 4.365 8.71e-05 ***
OriginTransplant:SiteSS -14.298 31.203 40.048 -0.458 0.649
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.590
SiteSS -0.604 0.489
OrgnTrn:SSS 0.418 -0.707 -0.692
eta_squared(Prot.S.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 2.00e-03 | [0.00, 1.00]
Site | 0.44 | [0.25, 1.00]
Origin:Site | 5.22e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Prot.S_TP4.res<-data.frame(summary(Prot.S.lme_TP4)$coefficients[-1,])
Prot.S_TP4.res$Predictor<-c("Origin", "Site", "Origin x Site")
Prot.S_TP4.res$EtaSq<-c(eta_squared(Prot.S.lme_TP4)$Eta2)
Prot.S_TP4.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP4.res))
Effect size of Origin for each Site
##KL
Prot.S.lme_TP4_KL<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="KL"),])
summary(Prot.S.lme_TP4_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "KL"), ]
REML criterion at convergence: 233.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.9026 -0.5130 -0.1508 0.5988 1.9630
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 123.5 11.11
Residual 3004.0 54.81
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 283.146 17.074 5.322 16.584 8.71e-06 ***
OriginTransplant 2.801 22.890 19.068 0.122 0.904
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.641
eta_squared(Prot.S.lme_TP4_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 7.84e-04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Prot.S.lme_TP4_SS<-lmer(TP_ug.cm2_S~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="SS"),])
summary(Prot.S.lme_TP4_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: TP_ug.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "SS"), ]
REML criterion at convergence: 231.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.95275 -0.71834 -0.03221 0.77696 1.62897
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 300.3 17.33
Residual 2653.9 51.52
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 377.337 17.924 4.502 21.05 1.14e-05 ***
OriginTransplant -10.979 21.525 19.180 -0.51 0.616
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.573
eta_squared(Prot.S.lme_TP4_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.01 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Prot.S_TP4.site.res<-data.frame(rbind(summary(Prot.S.lme_TP4_KL)$coefficients[-1,],
summary(Prot.S.lme_TP4_SS)$coefficients[-1,]))
Prot.S_TP4.site.res$Predictor<-c("KL Origin", "SS Origin")
Prot.S_TP4.site.res$EtaSq<-c(eta_squared(Prot.S.lme_TP4_KL)$Eta2, eta_squared(Prot.S.lme_TP4_SS)$Eta2)
Prot.S_TP4.site.res$Response<-rep("Protein Symbiont", nrow(Prot.S_TP4.site.res))
##Combine results
Prot.S_TP4.res<-rbind(Prot.S_TP4.res, Prot.S_TP4.site.res)
##Summary statistics by Site and Origin
TP4_ProtSym.sum<-summarySE(Coral.TP4, measurevar="TP_ug.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Protein across Treatments
TP4_ProtSym.plot<-ggplot(TP4_ProtSym.sum, aes(x=Site, y=TP_ug.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=TP_ug.cm2_S-se, ymax=TP_ug.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Protein (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(250, 550); TP4_ProtSym.plot
##Check normality
hist(Coral.TP4$AFDW_mg.cm2_C)
shapiro.test(Coral.TP4$AFDW_mg.cm2_C)
Shapiro-Wilk normality test
data: Coral.TP4$AFDW_mg.cm2_C
W = 0.98656, p-value = 0.8669
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.C.lme_TP4<-lmer(AFDW_mg.cm2_C~Origin*Site+(1|Genotype), data=Coral.TP4)
##Check residuals
Bio.C.lme_res_TP4 <- simulateResiduals(fittedModel = Bio.C.lme_TP4, plot = F)
plot(Bio.C.lme_res_TP4)
##Model results
summary(Bio.C.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin * Site + (1 | Genotype)
Data: Coral.TP4
REML criterion at convergence: 31.4
Scaled residuals:
Min 1Q Median 3Q Max
-1.94819 -0.65333 0.01107 0.59003 2.21357
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0006586 0.02566
Residual 0.0974518 0.31217
Number of obs: 46, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.99501 0.09133 19.92205 10.895 7.67e-10 ***
OriginTransplant 0.17260 0.13032 40.29158 1.324 0.1928
SiteSS 0.33916 0.12744 40.15351 2.661 0.0111 *
OriginTransplant:SiteSS -0.38438 0.18428 40.15351 -2.086 0.0434 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.682
SiteSS -0.698 0.489
OrgnTrn:SSS 0.483 -0.707 -0.692
eta_squared(Bio.C.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 1.12e-03 | [0.00, 1.00]
Site | 0.06 | [0.00, 1.00]
Origin:Site | 0.10 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.C_TP4.res<-data.frame(summary(Bio.C.lme_TP4)$coefficients[-1,])
Bio.C_TP4.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.C_TP4.res$EtaSq<-c(eta_squared(Bio.C.lme_TP4)$Eta2)
Bio.C_TP4.res$Response<-rep("Biomass Host", nrow(Bio.C_TP4.res))
Effect size of Origin for each Site
##KL
Bio.C.lme_TP4_KL<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="KL"),])
boundary (singular) fit: see help('isSingular')
summary(Bio.C.lme_TP4_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "KL"), ]
REML criterion at convergence: 22.6
Scaled residuals:
Min 1Q Median 3Q Max
-1.65092 -0.56347 0.01929 0.47522 1.89563
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0000 0.0000
Residual 0.1361 0.3689
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.9950 0.1065 21.0000 9.344 6.27e-09 ***
OriginTransplant 0.1727 0.1540 21.0000 1.121 0.275
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.692
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Bio.C.lme_TP4_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.06 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.C.lme_TP4_SS<-lmer(AFDW_mg.cm2_C~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="SS"),])
summary(Bio.C.lme_TP4_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_C ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "SS"), ]
REML criterion at convergence: 4.4
Scaled residuals:
Min 1Q Median 3Q Max
-1.2767 -0.7007 0.1653 0.5506 2.0180
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.009792 0.09895
Residual 0.052524 0.22918
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.33417 0.08741 3.82984 15.263 0.000143 ***
OriginTransplant -0.20931 0.09578 19.12799 -2.185 0.041513 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.523
eta_squared(Bio.C.lme_TP4_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.20 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.C_TP4.site.res<-data.frame(rbind(summary(Bio.C.lme_TP4_KL)$coefficients[-1,],
summary(Bio.C.lme_TP4_SS)$coefficients[-1,]))
Bio.C_TP4.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.C_TP4.site.res$EtaSq<-c(eta_squared(Bio.C.lme_TP4_KL)$Eta2, eta_squared(Bio.C.lme_TP4_SS)$Eta2)
Bio.C_TP4.site.res$Response<-rep("Biomass Host", nrow(Bio.C_TP4.site.res))
##Combine results
Bio.C_TP4.res<-rbind(Bio.C_TP4.res, Bio.C_TP4.site.res)
##Summary statistics by Site and Origin
TP4_BioHost.sum<-summarySE(Coral.TP4, measurevar="AFDW_mg.cm2_C", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Host Biomass across Treatments
TP4_BioHost.plot<-ggplot(TP4_BioHost.sum, aes(x=Site, y=AFDW_mg.cm2_C, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_C-se, ymax=AFDW_mg.cm2_C+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Host Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.8, 1.6)+
annotate("text", x=2, y=1.45, label="*", size=sig.sz, fontface="bold"); TP4_BioHost.plot
##Check normality
hist(Coral.TP4$AFDW_mg.cm2_S)
shapiro.test(Coral.TP4$AFDW_mg.cm2_S)
Shapiro-Wilk normality test
data: Coral.TP4$AFDW_mg.cm2_S
W = 0.96144, p-value = 0.1304
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Bio.S.lme_TP4<-lmer(AFDW_mg.cm2_S~Origin*Site+(1|Genotype), data=Coral.TP4)
boundary (singular) fit: see help('isSingular')
##Check residuals
Bio.S.lme_res_TP4 <- simulateResiduals(fittedModel = Bio.S.lme_TP4, plot = F)
plot(Bio.S.lme_res_TP4)
##Model results
summary(Bio.S.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin * Site + (1 | Genotype)
Data: Coral.TP4
REML criterion at convergence: -13.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.9850 -0.7648 -0.1116 0.6976 1.8287
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.00000 0.0000
Residual 0.03381 0.1839
Number of obs: 46, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.58851 0.05308 42.00000 11.087 4.71e-14 ***
OriginTransplant 0.02029 0.07675 42.00000 0.264 0.7928
SiteSS 0.15893 0.07507 42.00000 2.117 0.0402 *
OriginTransplant:SiteSS -0.05653 0.10855 42.00000 -0.521 0.6052
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.692
SiteSS -0.707 0.489
OrgnTrn:SSS 0.489 -0.707 -0.692
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Bio.S.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 5.14e-04 | [0.00, 1.00]
Site | 0.12 | [0.01, 1.00]
Origin:Site | 6.42e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Bio.S_TP4.res<-data.frame(summary(Bio.S.lme_TP4)$coefficients[-1,])
Bio.S_TP4.res$Predictor<-c("Origin", "Site", "Origin x Site")
Bio.S_TP4.res$EtaSq<-c(eta_squared(Bio.S.lme_TP4)$Eta2)
Bio.S_TP4.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP4.res))
Effect size of Origin for each Site
##KL
Bio.S.lme_TP4_KL<-lmer(AFDW_mg.cm2_S~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="KL"),])
boundary (singular) fit: see help('isSingular')
summary(Bio.S.lme_TP4_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "KL"), ]
REML criterion at convergence: -9
Scaled residuals:
Min 1Q Median 3Q Max
-1.8536 -0.7454 -0.2379 0.7005 1.9338
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.00000 0.0000
Residual 0.03023 0.1739
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.58851 0.05019 21.00000 11.72 1.12e-10 ***
OriginTransplant 0.02029 0.07258 21.00000 0.28 0.783
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.692
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Bio.S.lme_TP4_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 3.71e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Bio.S.lme_TP4_SS<-lmer(AFDW_mg.cm2_S~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="SS"),])
boundary (singular) fit: see help('isSingular')
summary(Bio.S.lme_TP4_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: AFDW_mg.cm2_S ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "SS"), ]
REML criterion at convergence: -4.5
Scaled residuals:
Min 1Q Median 3Q Max
-1.8877 -0.8214 0.1483 0.7055 1.5821
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.00000 0.0000
Residual 0.03739 0.1934
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.74744 0.05582 21.00000 13.391 9.4e-12 ***
OriginTransplant -0.03625 0.08071 21.00000 -0.449 0.658
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.692
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Bio.S.lme_TP4_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 9.51e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Bio.S_TP4.site.res<-data.frame(rbind(summary(Bio.S.lme_TP4_KL)$coefficients[-1,],
summary(Bio.S.lme_TP4_SS)$coefficients[-1,]))
Bio.S_TP4.site.res$Predictor<-c("KL Origin", "SS Origin")
Bio.S_TP4.site.res$EtaSq<-c(eta_squared(Bio.S.lme_TP4_KL)$Eta2, eta_squared(Bio.S.lme_TP4_SS)$Eta2)
Bio.S_TP4.site.res$Response<-rep("Biomass Symbiont", nrow(Bio.S_TP4.site.res))
##Combine results
Bio.S_TP4.res<-rbind(Bio.S_TP4.res, Bio.S_TP4.site.res)
##Summary statistics by Site and Origin
TP4_BioSym.sum<-summarySE(Coral.TP4, measurevar="AFDW_mg.cm2_S", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Biomass across Treatments
TP4_BioSym.plot<-ggplot(TP4_BioSym.sum, aes(x=Site, y=AFDW_mg.cm2_S, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=AFDW_mg.cm2_S-se, ymax=AFDW_mg.cm2_S+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Symbiont Biomass (mg cm'^-2*")")), colour=NULL)+
ylim(0.45, 0.95); TP4_BioSym.plot
##Check normality
hist(Coral.TP4$Chl_ug.cm2)
shapiro.test(Coral.TP4$Chl_ug.cm2)
Shapiro-Wilk normality test
data: Coral.TP4$Chl_ug.cm2
W = 0.94799, p-value = 0.03927
#Slightly non normal
hist(log(Coral.TP4$Chl_ug.cm2+1))
shapiro.test(log(Coral.TP4$Chl_ug.cm2+1))
Shapiro-Wilk normality test
data: log(Coral.TP4$Chl_ug.cm2 + 1)
W = 0.97457, p-value = 0.4047
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interactions between Origin and Site
Chl.lme_TP4<-lmer(log(Chl_ug.cm2+1)~Origin*Site+(1|Genotype), data=Coral.TP4)
##Check residuals
Chl.lme_res_TP4 <- simulateResiduals(fittedModel = Chl.lme_TP4, plot = F)
plot(Chl.lme_res_TP4)
##Model results
summary(Chl.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl_ug.cm2 + 1) ~ Origin * Site + (1 | Genotype)
Data: Coral.TP4
REML criterion at convergence: -35.8
Scaled residuals:
Min 1Q Median 3Q Max
-2.5527 -0.6247 0.1083 0.5659 1.8596
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.02813 0.1677
Residual 0.01693 0.1301
Number of obs: 46, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.939828 0.103867 2.456396 9.048 0.00604 **
OriginTransplant -0.005543 0.054370 40.013465 -0.102 0.91931
SiteSS 0.335684 0.053119 40.006608 6.319 1.68e-07 ***
OriginTransplant:SiteSS 0.049977 0.076810 40.006608 0.651 0.51899
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.250
SiteSS -0.256 0.489
OrgnTrn:SSS 0.177 -0.706 -0.692
eta_squared(Chl.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 6.34e-03 | [0.00, 1.00]
Site | 0.69 | [0.55, 1.00]
Origin:Site | 0.01 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save model results
Chl_TP4.res<-data.frame(summary(Chl.lme_TP4)$coefficients[-1,])
Chl_TP4.res$Predictor<-c("Origin", "Site", "Origin x Site")
Chl_TP4.res$EtaSq<-c(eta_squared(Chl.lme_TP4)$Eta2)
Chl_TP4.res$Response<-rep("Chlorophyll", nrow(Chl_TP4.res))
Effect size of Origin for each Site
##KL
Chl.lme_TP4_KL<-lmer(log(Chl_ug.cm2+1)~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="KL"),])
summary(Chl.lme_TP4_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl_ug.cm2 + 1) ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "KL"), ]
REML criterion at convergence: -14
Scaled residuals:
Min 1Q Median 3Q Max
-1.59344 -0.58861 -0.05038 0.48137 1.88220
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.01194 0.1093
Residual 0.02028 0.1424
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.939828 0.075300 2.739672 12.481 0.00171 **
OriginTransplant -0.005243 0.059554 19.055343 -0.088 0.93076
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.377
eta_squared(Chl.lme_TP4_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 4.07e-04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Chl.lme_TP4_SS<-lmer(log(Chl_ug.cm2+1)~Origin+(1|Genotype), data=Coral.TP4[which(Coral.TP4$Site=="SS"),])
summary(Chl.lme_TP4_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl_ug.cm2 + 1) ~ Origin + (1 | Genotype)
Data: Coral.TP4[which(Coral.TP4$Site == "SS"), ]
REML criterion at convergence: -25
Scaled residuals:
Min 1Q Median 3Q Max
-2.80744 -0.47238 0.03677 0.58308 1.31155
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.049098 0.22158
Residual 0.009964 0.09982
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 1.27551 0.13113 2.09990 9.727 0.00885 **
OriginTransplant 0.04346 0.04175 19.00925 1.041 0.31096
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.152
eta_squared(Chl.lme_TP4_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.05 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Save results
Chl_TP4.site.res<-data.frame(rbind(summary(Chl.lme_TP4_KL)$coefficients[-1,],
summary(Chl.lme_TP4_SS)$coefficients[-1,]))
Chl_TP4.site.res$Predictor<-c("KL Origin", "SS Origin")
Chl_TP4.site.res$EtaSq<-c(eta_squared(Chl.lme_TP4_KL)$Eta2, eta_squared(Chl.lme_TP4_SS)$Eta2)
Chl_TP4.site.res$Response<-rep("Chlorophyll", nrow(Chl_TP4.site.res))
##Combine results
Chl_TP4.res<-rbind(Chl_TP4.res, Chl_TP4.site.res)
##Summary statistics by Site and Origin
TP4_Chl.sum<-summarySE(Coral.TP4, measurevar="Chl_ug.cm2", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Chlorophyll across Treatments
TP4_Chl.plot<-ggplot(TP4_Chl.sum, aes(x=Site, y=Chl_ug.cm2, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl_ug.cm2-se, ymax=Chl_ug.cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position="top")+
labs(x="Site and Origin", y=expression(paste('Total Chlorophyll (\u03BCg cm'^-2*")")), colour=NULL)+
ylim(0.5, 3.25); TP4_Chl.plot
##Combine Results
Phys_T4.res<-rbind(Prot.C_TP4.res, Prot.S_TP4.res, Bio.C_TP4.res, Bio.S_TP4.res, Chl_TP4.res)
##Add Timepoint
Phys_T4.res$TimeP<-rep("TP4", nrow(Phys_T4.res))
##Dataframe of effect size results
Phys.ES<-rbind(Phys_T1.res, Phys_T2.res, Phys_T3.res, Phys_T4.res)
Phys.ES<-Phys.ES %>% dplyr::rename(p = Pr...t..)
Phys.ES<-Phys.ES[,c("TimeP", "Predictor", "Response", "EtaSq", "p")]
##Site specific results
Phys.ES<-Phys.ES[which(Phys.ES$Predictor=="KL Origin" | Phys.ES$Predictor=="SS Origin"),]
Phys.ES<-Phys.ES %>% separate_wider_delim(cols="Predictor", delim=" ", names=c("Site", "Predictor"), cols_remove = TRUE)
##Add Metric names
Phys.ES$Metric<-ifelse(Phys.ES$Response== "Protein Host", "TP_ug.cm2_C", ifelse(
Phys.ES$Response== "Protein Symbiont", "TP_ug.cm2_S", ifelse(
Phys.ES$Response=="Biomass Host", "AFDW_mg.cm2_C", ifelse(
Phys.ES$Response=="Biomass Symbiont", "AFDW_mg.cm2_S", ifelse(
Phys.ES$Response=="Chlorophyll", "Chl_ug.cm2", NA)))))
##Add Significance levels
Phys.ES$Sig<-ifelse(Phys.ES$p<0.001, "***", ifelse(Phys.ES$p<0.01, "**",
ifelse(Phys.ES$p<0.05, "*", ifelse(Phys.ES$p<0.1, "-", NA))))
Bio.C.ES.plot<-ggplot(Phys.ES[which(Phys.ES$Metric=="AFDW_mg.cm2_C"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Host Biomass")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5),
axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position=c(.9, .8))+
labs(x="Time Point", y=expression(paste("Origin Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.6)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold"); Bio.C.ES.plot
Bio.S.ES.plot<-ggplot(Phys.ES[which(Phys.ES$Metric=="AFDW_mg.cm2_S"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Symbiont Biomass")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5),
axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position=c(.9, .8))+
labs(x="Time Point", y=expression(paste("Origin Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.6)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold"); Bio.S.ES.plot
Prot.S.ES.plot<-ggplot(Phys.ES[which(Phys.ES$Metric=="TP_ug.cm2_S"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Symbiont Protein")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5),
axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position=c(.9, .8))+
labs(x="Time Point", y=expression(paste("Origin Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.6)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold"); Prot.S.ES.plot
Chl.ES.plot<-ggplot(Phys.ES[which(Phys.ES$Metric=="Chl_ug.cm2"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Chlorophyll")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5),
axis.title.x = element_text(size = axis.title.sz),
axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"),
axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz),
legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"),
legend.position=c(.9, .8))+
labs(x="Time Point", y=expression(paste("Origin Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.6)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold"); Chl.ES.plot
##Biomass Host
TP1_BioHost.plot<-TP1_BioHost.plot+ ggtitle("TP1")+ labs(x="")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),
legend.position=c(0.5, 0.85), legend.direction="horizontal")+
guides(color=guide_legend(nrow=2, byrow=FALSE))
TP2_BioHost.plot<-TP2_BioHost.plot+ ggtitle("TP2")+ labs(x="", y="") +
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),
legend.position="none")
TP3_BioHost.plot<-TP3_BioHost.plot+ ggtitle("TP3")+ labs(x="", y="") +
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),
legend.position="none")
TP4_BioHost.plot<-TP4_BioHost.plot+ ggtitle("TP4")+ labs(x="", y="") +
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),
legend.position="none")
Bio.C.ES.plot<-Bio.C.ES.plot + labs(x="") + theme(legend.position=c(.15, .8))
##Biomass Symbiont
TP1_BioSym.plot<-TP1_BioSym.plot + labs(x="") + theme(legend.position="none")
TP2_BioSym.plot<-TP2_BioSym.plot + labs(x="", y="") + theme(legend.position="none")
TP3_BioSym.plot<-TP3_BioSym.plot + labs(x="", y="") + theme(legend.position="none")
TP4_BioSym.plot<-TP4_BioSym.plot + labs(x="", y="") + theme(legend.position="none")
Bio.S.ES.plot<-Bio.S.ES.plot + labs(x="") + theme(legend.position="none")
##Protein Symbiont
TP1_ProtSym.plot<-TP1_ProtSym.plot + labs(x="") + theme(legend.position="none")
TP2_ProtSym.plot<-TP2_ProtSym.plot + labs(x="", y="") + theme(legend.position="none")
TP3_ProtSym.plot<-TP3_ProtSym.plot + labs(x="", y="") + theme(legend.position="none")
TP4_ProtSym.plot<-TP4_ProtSym.plot + labs(x="", y="") + theme(legend.position="none")
Prot.S.ES.plot<-Prot.S.ES.plot + labs(x="") + theme(legend.position="none")
##Chlorophyll
TP1_Chl.plot<-TP1_Chl.plot + theme(legend.position="none")
TP2_Chl.plot<-TP2_Chl.plot + labs(y="") + theme(legend.position="none")
TP3_Chl.plot<-TP3_Chl.plot + labs(y="") + theme(legend.position="none")
TP4_Chl.plot<-TP4_Chl.plot + labs(y="") + theme(legend.position="none")
Chl.ES.plot<-Chl.ES.plot + theme(legend.position="none")
##Create Panel
Phys_fig<-plot_grid(TP1_BioHost.plot, TP2_BioHost.plot,
TP3_BioHost.plot, TP4_BioHost.plot, Bio.C.ES.plot,
TP1_BioSym.plot, TP2_BioSym.plot,
TP3_BioSym.plot, TP4_BioSym.plot, Bio.S.ES.plot,
TP1_ProtSym.plot, TP2_ProtSym.plot,
TP3_ProtSym.plot, TP4_ProtSym.plot, Prot.S.ES.plot,
TP1_Chl.plot, TP2_Chl.plot,
TP3_Chl.plot, TP4_Chl.plot, Chl.ES.plot,
rel_widths=c(0.8, 0.8, 0.8, 0.8, 1), rel_heights = 1,
nrow=4, ncol=5, byrow=T, labels = NULL)
Warning: Removed 5 rows containing missing values (`geom_text()`).Warning: Removed 6 rows containing missing values (`geom_text()`).Warning: Removed 7 rows containing missing values (`geom_text()`).Warning: Removed 4 rows containing missing values (`geom_text()`).
##Save Figure
ggsave(filename="Figures/02_Physiology/Fig3_Physiology.png", plot=Phys_fig, dpi=300, width=16, height=16, units="in")
##Combine Results Tables
TableS3A_Phys.PERM<-data.frame(rbind(PERM_T1.res, PERM_T2.res, PERM_T3.res, PERM_T4.res))
##Organize
names(TableS3A_Phys.PERM)
[1] "Df" "SumOfSqs" "F" "parOmegaSq" "Pr..F." "Predictor" "p_DISP"
[8] "Timepoint"
TableS3A_Phys.PERM<-TableS3A_Phys.PERM %>% dplyr::rename( DF = Df, SS = SumOfSqs, EffectSize = parOmegaSq, p = Pr..F.)
TableS3A_Phys.PERM<-TableS3A_Phys.PERM[,c("Timepoint", "Predictor", "DF", "SS", "F", "EffectSize", "p", "p_DISP")]
#Round to 3 digits
TableS3A_Phys.PERM$SS<-round(TableS3A_Phys.PERM$SS, 3)
TableS3A_Phys.PERM$F<-round(TableS3A_Phys.PERM$F, 3)
TableS3A_Phys.PERM$EffectSize<-round(TableS3A_Phys.PERM$EffectSize, 3)
TableS3A_Phys.PERM$p<-round(TableS3A_Phys.PERM$p, 3)
TableS3A_Phys.PERM$p_DISP<-round(TableS3A_Phys.PERM$p_DISP, 3)
##Write Out Table
write.csv(TableS3A_Phys.PERM, "Tables/TableS3A_Physiology_PERM_Results.csv", row.names=FALSE)
##Combine Results Tables
TableS4_Phys.LM<-data.frame(rbind(Phys_T1.res, Phys_T2.res, Phys_T3.res, Phys_T4.res))
##Organize
names(TableS4_Phys.LM)
[1] "Estimate" "Std..Error" "df" "t.value" "Pr...t.." "Predictor" "EtaSq"
[8] "Response" "TimeP"
TableS4_Phys.LM<-TableS4_Phys.LM %>% dplyr::rename(SE = Std..Error, DF = df, t = t.value, p = Pr...t.., EffectSize = EtaSq, Timepoint = TimeP)
TableS4_Phys.LM<-TableS4_Phys.LM[,c("Timepoint", "Response", "Predictor", "Estimate", "SE", "DF", "t", "p", "EffectSize")]
#Round to 3 digits
TableS4_Phys.LM$Estimate<-round(TableS4_Phys.LM$Estimate, 3)
TableS4_Phys.LM$SE<-round(TableS4_Phys.LM$SE, 3)
TableS4_Phys.LM$t<-round(TableS4_Phys.LM$t, 3)
TableS4_Phys.LM$p<-round(TableS4_Phys.LM$p, 3)
TableS4_Phys.LM$EffectSize<-round(TableS4_Phys.LM$EffectSize, 3)
#Integer
TableS4_Phys.LM$DF<-round(TableS4_Phys.LM$DF, 0)
##Write Out Table
write.csv(TableS4_Phys.LM, "Tables/TableS4_Physiology_LM_Results.csv", row.names=FALSE)